Skip to content

[ET][Portable] Fix op constant_pad_nd #708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions kernels/portable/cpu/op_constant_pad_nd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ void constant_pad_nd_out_impl(

size_t ndim = self.dim();

if (ndim == 0) {
out_data[0] = self_data[0];
return;
}

int64_t self_sizes[kTensorDimensionLimit];
int64_t self_strides[kTensorDimensionLimit];
int64_t out_sizes[kTensorDimensionLimit];
Expand Down