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 @@ -468,17 +468,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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试时请关注对模型的性能影响,是否有明显的性能回退发生,后续可以看是否能把优化的问题修复

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,收到

// 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