Skip to content

Commit

Permalink
fix points_in_box bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
momo609 committed Jun 11, 2024
1 parent 085f1d6 commit ba70ee3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mmcv/ops/points_in_boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ def points_in_boxes_part(points: Tensor, boxes: Tensor) -> Tensor:
points_device = points.get_device()
assert points_device == boxes.get_device(), \
'Points and boxes should be put on the same device'
if torch.cuda.current_device() != points_device:
torch.cuda.set_device(points_device)
if points_device != 'npu':
if torch.cuda.current_device() != points_device:
torch.cuda.set_device(points_device)

ext_module.points_in_boxes_part_forward(boxes.contiguous(),
points.contiguous(),
Expand Down

0 comments on commit ba70ee3

Please sign in to comment.