From e9c17c11e218aeea4fb5e61a8d8db982da06de00 Mon Sep 17 00:00:00 2001 From: hust17yixuan <303660421@qq.com> Date: Mon, 9 Dec 2024 15:49:49 +0800 Subject: [PATCH] fix bug forward --- mmcv/ops/modulated_deform_conv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mmcv/ops/modulated_deform_conv.py b/mmcv/ops/modulated_deform_conv.py index 83c9544e7f..7796044e8c 100644 --- a/mmcv/ops/modulated_deform_conv.py +++ b/mmcv/ops/modulated_deform_conv.py @@ -56,7 +56,8 @@ def _npu_forward(ctx, input_tensor, offset, mask, weight, bias): kernel_h, kernel_w, ctx.deform_groups) select_offset = offset.index_select(1, sort_index_fp) offset_all = torch.cat([select_offset, mask], dim=1) - output, offset_out = torch.npu_deformable_conv2d( + import torch_npu + output, offset_out = torch_npu.npu_deformable_conv2d( input_tensor, weight, offset_all,