Skip to content

Commit 1f4da85

Browse files
authored
resize output tensor
Differential Revision: D70218118 Pull Request resolved: #8714
1 parent d651dcd commit 1f4da85

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

kernels/optimized/cpu/op_gelu.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ Tensor& opt_gelu_out(
9898
ET_KERNEL_CHECK(
9999
context, check_gelu_args(input, approximate, out), InvalidArgument, out);
100100

101+
ET_KERNEL_CHECK(
102+
context,
103+
resize_tensor(out, input.sizes()) == Error::Ok,
104+
InvalidArgument,
105+
out);
106+
101107
ET_SWITCH_FLOATHBF16_TYPES(
102108
input.scalar_type(), context, "gelu.out", CTYPE, [&]() {
103109
gelu<CTYPE>(context, input, approximate, out);

0 commit comments

Comments
 (0)