Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
MMCV
Commits
8d87bf44
Unverified
Commit
8d87bf44
authored
Jun 15, 2023
by
Yinlei Sun
Committed by
GitHub
Jun 15, 2023
Browse files
[Fix] Fix deform_conv ops on Ascend NPU (#2832)
parent
e322848e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
mmcv/ops/deform_conv.py
mmcv/ops/deform_conv.py
+2
-1
mmcv/ops/modulated_deform_conv.py
mmcv/ops/modulated_deform_conv.py
+5
-2
No files found.
mmcv/ops/deform_conv.py
View file @
8d87bf44
...
@@ -57,7 +57,8 @@ class DeformConv2dFunction(Function):
...
@@ -57,7 +57,8 @@ class DeformConv2dFunction(Function):
input_tensor
,
grad_output
,
offset_out
,
weight
,
offset_all
,
input_tensor
,
grad_output
,
offset_out
,
weight
,
offset_all
,
kernel_size
=
[
weight
.
shape
[
3
],
weight
.
shape
[
2
]],
kernel_size
=
[
weight
.
shape
[
3
],
weight
.
shape
[
2
]],
stride
=
[
1
,
1
,
ctx
.
stride
[
0
],
ctx
.
stride
[
1
]],
stride
=
[
1
,
1
,
ctx
.
stride
[
0
],
ctx
.
stride
[
1
]],
padding
=
[
1
,
1
,
ctx
.
padding
[
0
],
ctx
.
padding
[
1
]],
padding
=
[
ctx
.
padding
[
0
],
ctx
.
padding
[
0
],
ctx
.
padding
[
1
],
ctx
.
padding
[
1
]],
dilation
=
[
1
,
1
,
ctx
.
dilation
[
0
],
ctx
.
dilation
[
1
]],
dilation
=
[
1
,
1
,
ctx
.
dilation
[
0
],
ctx
.
dilation
[
1
]],
groups
=
ctx
.
groups
,
deformable_groups
=
ctx
.
deform_groups
,
groups
=
ctx
.
groups
,
deformable_groups
=
ctx
.
deform_groups
,
modulated
=
True
)
modulated
=
True
)
...
...
mmcv/ops/modulated_deform_conv.py
View file @
8d87bf44
...
@@ -64,7 +64,9 @@ class ModulatedDeformConv2dFunction(Function):
...
@@ -64,7 +64,9 @@ class ModulatedDeformConv2dFunction(Function):
conv2d_bias
,
conv2d_bias
,
kernel_size
=
[
kernel_w
,
kernel_h
],
kernel_size
=
[
kernel_w
,
kernel_h
],
stride
=
[
1
,
1
,
ctx
.
stride
[
0
],
ctx
.
stride
[
1
]],
stride
=
[
1
,
1
,
ctx
.
stride
[
0
],
ctx
.
stride
[
1
]],
padding
=
[
1
,
1
,
ctx
.
padding
[
0
],
ctx
.
padding
[
1
]],
padding
=
[
ctx
.
padding
[
0
],
ctx
.
padding
[
0
],
ctx
.
padding
[
1
],
ctx
.
padding
[
1
]
],
dilation
=
[
1
,
1
,
ctx
.
dilation
[
0
],
ctx
.
dilation
[
1
]],
dilation
=
[
1
,
1
,
ctx
.
dilation
[
0
],
ctx
.
dilation
[
1
]],
groups
=
ctx
.
groups
,
groups
=
ctx
.
groups
,
deformable_groups
=
ctx
.
deform_groups
,
deformable_groups
=
ctx
.
deform_groups
,
...
@@ -84,7 +86,8 @@ class ModulatedDeformConv2dFunction(Function):
...
@@ -84,7 +86,8 @@ class ModulatedDeformConv2dFunction(Function):
input_tensor
,
grad_output
,
offset_out
,
weight
,
offset_all
,
input_tensor
,
grad_output
,
offset_out
,
weight
,
offset_all
,
kernel_size
=
[
weight
.
shape
[
3
],
weight
.
shape
[
2
]],
kernel_size
=
[
weight
.
shape
[
3
],
weight
.
shape
[
2
]],
stride
=
[
1
,
1
,
ctx
.
stride
[
0
],
ctx
.
stride
[
1
]],
stride
=
[
1
,
1
,
ctx
.
stride
[
0
],
ctx
.
stride
[
1
]],
padding
=
[
1
,
1
,
ctx
.
padding
[
0
],
ctx
.
padding
[
1
]],
padding
=
[
ctx
.
padding
[
0
],
ctx
.
padding
[
0
],
ctx
.
padding
[
1
],
ctx
.
padding
[
1
]],
dilation
=
[
1
,
1
,
ctx
.
dilation
[
0
],
ctx
.
dilation
[
1
]],
dilation
=
[
1
,
1
,
ctx
.
dilation
[
0
],
ctx
.
dilation
[
1
]],
groups
=
ctx
.
groups
,
deformable_groups
=
ctx
.
deform_groups
,
groups
=
ctx
.
groups
,
deformable_groups
=
ctx
.
deform_groups
,
modulated
=
True
)
modulated
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment