Skip to content

Remove useless check in slice_impl #50808

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

Merged
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
11 changes: 0 additions & 11 deletions paddle/phi/kernels/impl/slice_kernel_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,8 @@ void SliceCompute(const Context& ctx,
// Step 1: Get the accurate attribute value of starts and ends
std::vector<int64_t> starts = starts_t;
std::vector<int64_t> ends = ends_t;
PADDLE_ENFORCE_EQ(
starts.size(),
axes.size(),
phi::errors::InvalidArgument(
"The size of starts must be equal to the size of axes."));
PADDLE_ENFORCE_EQ(ends.size(),
axes.size(),
phi::errors::InvalidArgument(
"The size of ends must be equal to the size of axes."));

// Step 2: Compute output
auto in = &input;

auto in_dims = in->dims();
auto out_dims = out->dims();
auto slice_dims = out_dims;
Expand Down