Skip to content

Commit

Permalink
[Fix] Fix modulated_deform_conv.py for torch_npu v2.1 (#2983)
Browse files Browse the repository at this point in the history
  • Loading branch information
shun001 committed Nov 13, 2023
1 parent b366e92 commit 5040148
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mmcv/ops/modulated_deform_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ def _npu_forward(ctx, input_tensor, offset, mask, weight, bias):
def _npu_backward(ctx, grad_output):
input_tensor, weight, offset_out, offset_all, sort_index_bp = \
ctx.saved_tensors
import torch_npu
grad_input, grad_weight, grad_offset_all, grad_bias = \
torch.npu_deformable_conv2dbk(
torch_npu.npu_deformable_conv2dbk(
input_tensor, grad_output, offset_out, weight, offset_all,
kernel_size=[weight.shape[3], weight.shape[2]],
stride=[1, 1, ctx.stride[0], ctx.stride[1]],
Expand Down

0 comments on commit 5040148

Please sign in to comment.