| 392 | |
| 393 | |
| 394 | def test_nms_wrong_aux_input_shape(): |
| 395 | bb = relax.BlockBuilder() |
| 396 | data = relax.Var("data", R.Tensor((2, 10, 6), "float32")) |
| 397 | valid_count_bad_batch = relax.Var("valid_count_bad_batch", R.Tensor((3,), "int32")) |
| 398 | valid_count = relax.Var("valid_count", R.Tensor((2,), "int32")) |
| 399 | indices_bad_batch = relax.Var("indices_bad_batch", R.Tensor((3, 10), "int32")) |
| 400 | indices_bad_anchors = relax.Var("indices_bad_anchors", R.Tensor((2, 9), "int32")) |
| 401 | with pytest.raises(ValueError): |
| 402 | bb.normalize( |
| 403 | relax.op.vision.non_max_suppression(data, valid_count_bad_batch, indices_bad_anchors) |
| 404 | ) |
| 405 | with pytest.raises(ValueError): |
| 406 | bb.normalize(relax.op.vision.non_max_suppression(data, valid_count, indices_bad_batch)) |
| 407 | with pytest.raises(ValueError): |
| 408 | bb.normalize(relax.op.vision.non_max_suppression(data, valid_count, indices_bad_anchors)) |
| 409 | |
| 410 | |
| 411 | def test_nms_invalid_indices(): |