Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#33 from HuangShiqing/paddlebox
Browse files Browse the repository at this point in the history
abacus-aibox-919 fix the partial_concat's shape error
  • Loading branch information
HuangShiqing authored Dec 12, 2023
2 parents bd08b0a + 3f840d1 commit b3cea20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paddle/fluid/operators/partial_concat_op_xpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class PartialConcatXPUKernel : public framework::OpKernel<T> {

std::vector<int> xshape = phi::vectorize<int>(in_vars[i]->dims());
std::vector<int> starts = {0, start_index};
std::vector<int> ends = {batch_size, start_index + partial_len + 1};//要截取的x的每个维度的终止坐标(不包含)
std::vector<int> ends = {batch_size, start_index + partial_len};//要截取的x的每个维度的终止坐标(不包含)

int r = xpu::slice<T>(xpu_context,
input_data,
Expand Down Expand Up @@ -129,7 +129,7 @@ class PartialConcatGradXPUKernel : public framework::OpKernel<T> {

std::vector<int> xshape = phi::vectorize<int>(out_grad->dims());
std::vector<int> starts = {0, int(partial_len * i)};
std::vector<int> ends = {batch_size, int(partial_len * i + partial_len + 1)};//要截取的x的每个维度的终止坐标(不包含)
std::vector<int> ends = {batch_size, int(partial_len * i + partial_len)};//要截取的x的每个维度的终止坐标(不包含)

int r = xpu::slice<T>(xpu_context,
out_grad_data,
Expand Down

0 comments on commit b3cea20

Please sign in to comment.