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
4e8972fb
Unverified
Commit
4e8972fb
authored
Mar 20, 2023
by
liuhw
Committed by
GitHub
Mar 20, 2023
Browse files
Move voxel_size to the device where points are (#2681)
* ... * ... * ...
parent
06fa3285
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
mmcv/ops/csrc/pytorch/npu/voxelization_npu.cpp
mmcv/ops/csrc/pytorch/npu/voxelization_npu.cpp
+2
-4
No files found.
mmcv/ops/csrc/pytorch/npu/voxelization_npu.cpp
View file @
4e8972fb
...
...
@@ -24,13 +24,11 @@ int hard_voxelize_forward_npu(const at::Tensor &points, at::Tensor &voxels,
at
::
Tensor
voxel_size_cpu
=
at
::
from_blob
(
const_cast
<
float
*>
(
voxel_size
.
data
()),
{
3
},
dtype
(
at
::
kFloat
));
at
::
Tensor
voxel_size_npu
=
CalcuOpUtil
::
CopyTensorHostToDevice
(
voxel_size_cpu
);
at
::
Tensor
voxel_size_npu
=
voxel_size_cpu
.
to
(
points
.
device
());
at
::
Tensor
coors_range_cpu
=
at
::
from_blob
(
const_cast
<
float
*>
(
coors_range
.
data
()),
{
6
},
dtype
(
at
::
kFloat
));
at
::
Tensor
coors_range_npu
=
CalcuOpUtil
::
CopyTensorHostToDevice
(
coors_range_cpu
);
at
::
Tensor
coors_range_npu
=
coors_range_cpu
.
to
(
points
.
device
());
int64_t
max_points_
=
(
int64_t
)
max_points
;
int64_t
max_voxels_
=
(
int64_t
)
max_voxels
;
...
...
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