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
OpenPCDet
Commits
633db6be
Unverified
Commit
633db6be
authored
Jan 30, 2023
by
Duo Li
Committed by
GitHub
Jan 30, 2023
Browse files
Update loss_utils.py (#1247)
parent
e948c537
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
pcdet/utils/loss_utils.py
pcdet/utils/loss_utils.py
+2
-1
No files found.
pcdet/utils/loss_utils.py
View file @
633db6be
...
@@ -148,6 +148,7 @@ class WeightedL1Loss(nn.Module):
...
@@ -148,6 +148,7 @@ class WeightedL1Loss(nn.Module):
self
.
code_weights
=
np
.
array
(
code_weights
,
dtype
=
np
.
float32
)
self
.
code_weights
=
np
.
array
(
code_weights
,
dtype
=
np
.
float32
)
self
.
code_weights
=
torch
.
from_numpy
(
self
.
code_weights
).
cuda
()
self
.
code_weights
=
torch
.
from_numpy
(
self
.
code_weights
).
cuda
()
@
torch
.
amp
.
cuda
.
custom_fwd
(
cast_inputs
=
torch
.
float16
)
def
forward
(
self
,
input
:
torch
.
Tensor
,
target
:
torch
.
Tensor
,
weights
:
torch
.
Tensor
=
None
):
def
forward
(
self
,
input
:
torch
.
Tensor
,
target
:
torch
.
Tensor
,
weights
:
torch
.
Tensor
=
None
):
"""
"""
Args:
Args:
...
@@ -383,4 +384,4 @@ class RegLossCenterNet(nn.Module):
...
@@ -383,4 +384,4 @@ class RegLossCenterNet(nn.Module):
else
:
else
:
pred
=
_transpose_and_gather_feat
(
output
,
ind
)
pred
=
_transpose_and_gather_feat
(
output
,
ind
)
loss
=
_reg_loss
(
pred
,
target
,
mask
)
loss
=
_reg_loss
(
pred
,
target
,
mask
)
return
loss
return
loss
\ No newline at end of file
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