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
75290685
Unverified
Commit
75290685
authored
Mar 15, 2023
by
sherie
Committed by
GitHub
Mar 15, 2023
Browse files
[Enhancement] Refine the implementation of NMS op in Ascend device (#2658)
parent
9a671e48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
mmcv/ops/csrc/pytorch/npu/nms_npu.cpp
mmcv/ops/csrc/pytorch/npu/nms_npu.cpp
+2
-4
No files found.
mmcv/ops/csrc/pytorch/npu/nms_npu.cpp
View file @
75290685
...
...
@@ -4,10 +4,7 @@ using namespace NPU_NAME_SPACE;
using
namespace
std
;
Tensor
nms_npu
(
Tensor
boxes
,
Tensor
scores
,
float
iou_threshold
,
int
offset
)
{
at
::
Tensor
boxed_offest
=
at_npu
::
native
::
OpPreparation
::
ApplyTensor
(
boxes
);
at
::
Tensor
ones_tensor
=
at_npu
::
native
::
OpPreparation
::
ApplyTensor
(
boxes
).
fill_
(
1
);
at
::
add_out
(
boxed_offest
,
boxes
,
ones_tensor
,
offset
);
int64_t
offset_64
=
offset
;
at
::
Tensor
iou_threshold_y
=
at_npu
::
native
::
OpPreparation
::
ApplyTensor
(
{},
boxes
.
options
().
dtype
(
at
::
kFloat
),
boxes
)
.
fill_
(
iou_threshold
);
...
...
@@ -29,6 +26,7 @@ Tensor nms_npu(Tensor boxes, Tensor scores, float iou_threshold, int offset) {
.
Input
(
max_outputsize_y
)
.
Input
(
iou_threshold_y
)
.
Input
(
scores_threshold_y
)
.
Attr
(
"offset"
,
offset_64
)
.
Output
(
output
)
.
Run
();
auto
outputsizeBool
=
at
::
gt
(
output
,
-
1
);
...
...
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