Skip to content

Commit 00e92ab

Browse files
authored
[Fix] Fix deform_conv.py for torch_npu v2.1 (#2967)
1 parent 51a9943 commit 00e92ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mmcv/ops/deform_conv.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ def symbolic(g,
5151

5252
@staticmethod
5353
def _npu_backward(ctx, grad_output):
54+
import torch_npu
5455
input_tensor, weight, offset_out, offset_all, sort_index_for_npu_bp = \
5556
ctx.saved_tensors
5657
grad_input, grad_weight, grad_offset_all, grad_bias = \
57-
torch.npu_deformable_conv2dbk(
58+
torch_npu.npu_deformable_conv2dbk(
5859
input_tensor, grad_output, offset_out, weight, offset_all,
5960
kernel_size=[weight.shape[3], weight.shape[2]],
6061
stride=[1, 1, ctx.stride[0], ctx.stride[1]],

0 commit comments

Comments
 (0)