Skip to content

Commit

Permalink
Make sure there is no tie in scores in NMS test (#8335)
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi authored Jun 25, 2021
1 parent 9c0281b commit 8e830b4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/python/frontend/tensorflow/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -3427,8 +3427,14 @@ def _test_forward_combined_nms(
clip_boxes=False,
dtype="float32",
):
def get_random_scores(size, dtype):
size1d = np.prod(size)
scores = np.linspace(0, 1, num=size1d)
np.random.shuffle(scores)
return scores.reshape(size).astype(dtype)

boxes = np.random.uniform(-1, 2, size=bx_shape).astype(dtype)
scores = np.random.uniform(size=score_shape).astype(dtype)
scores = get_random_scores(score_shape, dtype)
max_output_size = np.int32(out_size)
tf.reset_default_graph()
in_data_1 = tf.placeholder(dtype, boxes.shape, name="in_data_1")
Expand Down

0 comments on commit 8e830b4

Please sign in to comment.