-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Centerpoint bbox coders: Fix torch warning #2873
base: dev-1.x
Are you sure you want to change the base?
Centerpoint bbox coders: Fix torch warning #2873
Conversation
@@ -36,7 +36,7 @@ def __init__(self, | |||
self.pc_range = pc_range | |||
self.out_size_factor = out_size_factor | |||
self.voxel_size = voxel_size | |||
self.post_center_range = post_center_range | |||
self.post_center_range = Tensor(post_center_range) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should notice that the default post_center_range
is None
, which may cause an error here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, I updated it so that it stays None in that case.
I added another small commit to fix the type annotation for |
Could someone please retrigger the pipelines that got stuck so this can get merged? |
Motivation
I currently get the following warning from the centerpoints bbox coder:
The reason is that
self.post_center_range
is already atorch.Tensor
after the first call of decode and thentorch.Tensor
is called on a Tensor in every following call.Modification
Create
self.post_center_range
as Tensor in the initialization ofCenterPointBBoxCoder
and only make sure that it is on the right device whendecode
is called.BC-breaking (Optional)
Does the modification introduce changes that break the back-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
No breaking/functionally relevant changes
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
Checklist