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
dcnv3
Commits
cb9f9ca2
Commit
cb9f9ca2
authored
Jun 05, 2025
by
zhanggzh
Browse files
add dcnv3 src code ande update readme file
parent
31c962dc
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
269 deletions
+64
-269
README.md
README.md
+56
-267
detection/ops_dcnv3/functions/__init__.py
detection/ops_dcnv3/functions/__init__.py
+1
-0
detection/ops_dcnv3/test.py
detection/ops_dcnv3/test.py
+7
-2
No files found.
README.md
View file @
cb9f9ca2
This diff is collapsed.
Click to expand it.
detection/ops_dcnv3/functions/__init__.py
View file @
cb9f9ca2
...
...
@@ -5,3 +5,4 @@
# --------------------------------------------------------
from
.dcnv3_func
import
DCNv3Function
,
dcnv3_core_pytorch
__version__
=
'0.1'
detection/ops_dcnv3/test.py
View file @
cb9f9ca2
...
...
@@ -52,8 +52,13 @@ def check_forward_equal_with_pytorch_double():
fwdok
=
torch
.
allclose
(
output_cuda
,
output_pytorch
)
max_abs_err
=
(
output_cuda
-
output_pytorch
).
abs
().
max
()
max_rel_err
=
((
output_cuda
-
output_pytorch
).
abs
()
/
output_pytorch
.
abs
()).
max
()
#max_rel_err = ((output_cuda - output_pytorch).abs() /
# output_pytorch.abs()).max()
non_zero_mask
=
output_pytorch
.
abs
()
>
0
if
non_zero_mask
.
any
():
max_rel_err
=
((
output_cuda
[
non_zero_mask
]
-
output_pytorch
[
non_zero_mask
]).
abs
()
/
output_pytorch
[
non_zero_mask
].
abs
()).
max
()
else
:
max_rel_err
=
0.0
# 如果所有值都为零,则相对误差为 0
print
(
'>>> forward double'
)
print
(
f
'*
{
fwdok
}
check_forward_equal_with_pytorch_double: max_abs_err
{
max_abs_err
:.
2
e
}
max_rel_err
{
max_rel_err
:.
2
e
}
'
)
...
...
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