Skip to content

Commit

Permalink
skip test_case in test_iou3d
Browse files Browse the repository at this point in the history
  • Loading branch information
cathyzhang222 committed Oct 20, 2022
1 parent a353622 commit 5a1b6fe
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions tests/test_ops/test_iou3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,18 @@ def test_nms3d(device):
assert np.allclose(inds.cpu().numpy(), np_inds)

# test for many boxes
# np.random.seed(42)
# np_boxes = np.random.rand(555, 7).astype(np.float32)
# np_scores = np.random.rand(555).astype(np.float32)
# boxes = torch.from_numpy(np_boxes)
# scores = torch.from_numpy(np_scores)
# inds = nms3d(boxes.to(device), scores.to(device), iou_threshold=0.3)

# assert len(inds.cpu().numpy()) == 176
# In the float data type calculation process, sometimes float will be
# converted to double in CUDA kernel, always use float in MLU kernel.
# The difference between the mentioned above leads to different results.
if device != 'mlu':
np.random.seed(42)
np_boxes = np.random.rand(555, 7).astype(np.float32)
np_scores = np.random.rand(555).astype(np.float32)
boxes = torch.from_numpy(np_boxes)
scores = torch.from_numpy(np_scores)
inds = nms3d(boxes.to(device), scores.to(device), iou_threshold=0.3)

assert len(inds.cpu().numpy()) == 176


@pytest.mark.parametrize('device', [
Expand Down

0 comments on commit 5a1b6fe

Please sign in to comment.