Skip to content

Commit 87577bc

Browse files
mcr229facebook-github-bot
authored andcommitted
resize output tensor
Summary: Optimized Gelu Kernel was failing to resize the output tensor, which was causing some issues later down the road. Differential Revision: D70218118
1 parent 2be4e94 commit 87577bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernels/optimized/cpu/op_gelu.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ 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, resize_tensor(out, input.sizes()) == Error::Ok, InvalidArgument, out);
103+
101104
ET_SWITCH_FLOATHBF16_TYPES(
102105
input.scalar_type(), context, "gelu.out", CTYPE, [&]() {
103106
gelu<CTYPE>(context, input, approximate, out);

0 commit comments

Comments
 (0)