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
c70fafeb
"mmdet/vscode:/vscode.git/clone" did not exist on "e5b666f951f64a3b705fa6cf4d4cccfb90b40bea"
Unverified
Commit
c70fafeb
authored
May 29, 2022
by
ShawnHu
Committed by
GitHub
May 29, 2022
Browse files
Add type hints in ops/assign_score_withk.py (#2023)
parent
de90c7a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
mmcv/ops/assign_score_withk.py
mmcv/ops/assign_score_withk.py
+11
-6
No files found.
mmcv/ops/assign_score_withk.py
View file @
c70fafeb
from
typing
import
Tuple
import
torch
from
torch.autograd
import
Function
from
torch.autograd
import
Function
from
..utils
import
ext_loader
from
..utils
import
ext_loader
...
@@ -27,11 +30,11 @@ class AssignScoreWithK(Function):
...
@@ -27,11 +30,11 @@ class AssignScoreWithK(Function):
@
staticmethod
@
staticmethod
def
forward
(
ctx
,
def
forward
(
ctx
,
scores
,
scores
:
torch
.
Tensor
,
point_features
,
point_features
:
torch
.
Tensor
,
center_features
,
center_features
:
torch
.
Tensor
,
knn_idx
,
knn_idx
:
torch
.
Tensor
,
aggregate
=
'sum'
)
:
aggregate
:
str
=
'sum'
)
->
torch
.
Tensor
:
"""
"""
Args:
Args:
scores (torch.Tensor): (B, npoint, K, M), predicted scores to
scores (torch.Tensor): (B, npoint, K, M), predicted scores to
...
@@ -78,7 +81,9 @@ class AssignScoreWithK(Function):
...
@@ -78,7 +81,9 @@ class AssignScoreWithK(Function):
return
output
return
output
@
staticmethod
@
staticmethod
def
backward
(
ctx
,
grad_out
):
def
backward
(
ctx
,
grad_out
:
torch
.
Tensor
)
->
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
,
torch
.
Tensor
,
None
,
None
]:
"""
"""
Args:
Args:
grad_out (torch.Tensor): (B, out_dim, npoint, K)
grad_out (torch.Tensor): (B, out_dim, npoint, K)
...
...
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