lsy643 edited a comment on pull request #6108:
URL: https://github.com/apache/incubator-tvm/pull/6108#issuecomment-683385549
@yongwww @Laurawly
I am quite confused about the test data used in `test_non_max_suppression`
from `tests/python/relay/test_op_level5.py`.
If I understand correctly, a `get_valid_count`, a `non_max_suppression` and
a `strided_slice` are used together as a `non_max_suppression` operator
according to `def _nms()` from `frontend/tensorflow.py`. The `get_valid_counts`
of the `cuda` version does not move valid boxes to the top of input data, while
the `get_valid_counts` of the `cpu` version does the job.
Therefore, it seems to make more sense if we use different test data for the
`test_non_max_suppression`
For example
``` python
the original data before get_valid_counts
np_data = np.array([[[0, 0.8, 1, 20, 25, 45],
[1, 0.7, 30, 60, 50, 80],
[0, 0.4, 4, 21, 19, 40],
[2, 0.9, 35, 61, 52, 79],
[1, 0.5, 100, 60, 70, 110]]]).astype("float32")
```
```python
cpu test data after get_valid_counts
np_data = np.array([[[0, 0.8, 1, 20, 25, 45],
[1, 0.7, 1, 20, 25, 45],
[2, 0.9, 35, 61, 52, 79],
[1, 0.5, 100, 60, 70, 110],
[-1, -1, -1, -1, -1, -1]]]).astype("float32")
np_indices = np.array([[0, 1, 3, 4, -1]]).astype("int32")
```
```python
cuda test data after get_valid_counts
np_data = np.array([[[0, 0.8, 1, 20, 25, 45],
[1, 0.7, 2, 21, 26, 45],
[-1, -1, -1, -1, -1, -1],
[2, 0.9, 35, 61, 52, 79],
[1, 0.5, 100, 60, 70, 110]]]).astype("float32")
np_indices = np.array([[0, 1, -1, 3, 4]]).astype("int32")
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]