Skip to content

Commit 5040148

Browse files
authored
[Fix] Fix modulated_deform_conv.py for torch_npu v2.1 (#2983)
1 parent b366e92 commit 5040148

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mmcv/ops/modulated_deform_conv.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ def _npu_forward(ctx, input_tensor, offset, mask, weight, bias):
8383
def _npu_backward(ctx, grad_output):
8484
input_tensor, weight, offset_out, offset_all, sort_index_bp = \
8585
ctx.saved_tensors
86+
import torch_npu
8687
grad_input, grad_weight, grad_offset_all, grad_bias = \
87-
torch.npu_deformable_conv2dbk(
88+
torch_npu.npu_deformable_conv2dbk(
8889
input_tensor, grad_output, offset_out, weight, offset_all,
8990
kernel_size=[weight.shape[3], weight.shape[2]],
9091
stride=[1, 1, ctx.stride[0], ctx.stride[1]],

0 commit comments

Comments
 (0)