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
0a2f60ba
Unverified
Commit
0a2f60ba
authored
Jul 10, 2023
by
sherie
Committed by
GitHub
Jul 10, 2023
Browse files
[Fix] Fix roi_align npu bug (#2862)
parent
43c5c76f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
mmcv/ops/csrc/pytorch/npu/roi_align_npu.cpp
mmcv/ops/csrc/pytorch/npu/roi_align_npu.cpp
+7
-2
No files found.
mmcv/ops/csrc/pytorch/npu/roi_align_npu.cpp
View file @
0a2f60ba
...
...
@@ -7,13 +7,14 @@ void roi_align_forward_npu(Tensor input, Tensor rois, Tensor output,
Tensor
argmax_y
,
Tensor
argmax_x
,
int
aligned_height
,
int
aligned_width
,
float
spatial_scale
,
int
sampling_ratio
,
int
pool_mode
,
bool
aligned
)
{
int64_t
roi_end_mode
=
2
;
if
(
!
aligned
)
{
LOG
(
WARNING
)
<<
"The [aligned] attr in roi_align op is false"
;
roi_end_mode
=
0
;
}
int64_t
aligned_height_64
=
aligned_height
;
int64_t
aligned_width_64
=
aligned_width
;
int64_t
sampling_ratio_64
=
sampling_ratio
;
int64_t
roi_end_mode
=
0
;
OpCommand
cmd
;
cmd
.
Name
(
"ROIAlign"
)
.
Input
(
input
)
...
...
@@ -35,7 +36,11 @@ void roi_align_backward_npu(Tensor grad_output, Tensor rois, Tensor argmax_y,
int64_t
aligned_height_64
=
aligned_height
;
int64_t
aligned_width_64
=
aligned_width
;
int64_t
sampling_ratio_64
=
sampling_ratio
;
int64_t
roi_end_mode
=
0
;
int64_t
roi_end_mode
=
2
;
if
(
!
aligned
)
{
LOG
(
WARNING
)
<<
"The [aligned] attr in roi_align_grad op is false"
;
roi_end_mode
=
0
;
}
c10
::
SmallVector
<
int64_t
,
SIZE
>
xdiff_shape
=
at_npu
::
native
::
array_to_small_vector
(
grad_input
.
sizes
());
OpCommand
cmd
;
...
...
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