Skip to content
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
12 changes: 1 addition & 11 deletions paddle/fluid/operators/slice_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,17 +391,7 @@ class SliceGradKernel : public framework::OpKernel<T> {
}
}

if (need_pad_num == 0) {
// do not need padding, pass if data address same, else copy
if (d_input->mutable_data<T>(context.GetPlace()) == d_out->data<T>()) {
// inplace, do not any operator, pass
} else {
framework::TensorCopy(
*d_out, context.GetPlace(),
context.template device_context<platform::DeviceContext>(),
d_input);
}
} else if (need_pad_num == 1) {
if (need_pad_num == 1) {
// only need padding one dimension, we can reduce dimension.
// only the padding dimension is available for us.
// How to reduce dimension(5 to 3 for example):
Expand Down