Skip to content

Commit

Permalink
fix roi_pool bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
momo609 committed Jun 11, 2024
1 parent ba70ee3 commit 65e40cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mmcv/ops/csrc/pytorch/npu/roi_pool_npu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ void roi_pool_backward_npu(Tensor grad_output, Tensor rois, Tensor argmax,
.Attr("spatial_scale_w", spatial_scale)
.Attr("pool_channel", pooled_channel)
.Run();
at::Tensor res = y.contiguous();
at::Tensor result = y.transpose(2, 3).transpose(1, 2);
at::Tensor res = result.contiguous();
grad_input.copy_(res);
}

Expand Down

0 comments on commit 65e40cf

Please sign in to comment.