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
3ad02efd
Unverified
Commit
3ad02efd
authored
Mar 15, 2023
by
liuhw
Committed by
GitHub
Mar 15, 2023
Browse files
[Fix] Prevent divide-by-zero error on Ascend device for bbox_overlaps (#2646)
parent
869dbf1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
mmcv/ops/csrc/pytorch/npu/bbox_overlaps_npu.cpp
mmcv/ops/csrc/pytorch/npu/bbox_overlaps_npu.cpp
+5
-1
No files found.
mmcv/ops/csrc/pytorch/npu/bbox_overlaps_npu.cpp
View file @
3ad02efd
...
...
@@ -12,6 +12,10 @@ void bbox_overlaps_npu(const Tensor bboxes1, const Tensor bboxes2, Tensor ious,
if
(
mode
==
1
)
{
modeStr
=
"iof"
;
}
float
offset_
=
1
;
if
(
offset
==
0
)
{
offset_
=
0.01
;
}
at
::
Tensor
bboxes
=
at
::
ones_like
(
bboxes2
);
at
::
Tensor
gtboxes
=
at
::
ones_like
(
bboxes1
);
bboxes
=
aligned
?
bboxes2
.
transpose
(
0
,
1
)
:
bboxes2
;
...
...
@@ -22,7 +26,7 @@ void bbox_overlaps_npu(const Tensor bboxes1, const Tensor bboxes2, Tensor ious,
.
Input
(
gtboxes
)
.
Output
(
ious
)
.
Attr
(
"mode"
,
modeStr
)
.
Attr
(
"eps"
,
(
float
)
offset
)
.
Attr
(
"eps"
,
offset
_
)
.
Attr
(
"aligned"
,
aligned
)
.
Run
();
}
...
...
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