diff --git a/tests/python/relay/test_op_level5.py b/tests/python/relay/test_op_level5.py index 10d0ea0d6d26..db910661ca2c 100644 --- a/tests/python/relay/test_op_level5.py +++ b/tests/python/relay/test_op_level5.py @@ -236,14 +236,18 @@ def test_crop_and_resize(self, target, dev, executor_kind, layout, interpolate_m extrapolation_value = 0.0 + np.random.seed(0) + + eps = 1e-4 + if layout == "NHWC": img_shape = (10, 224, 224, 3) - boxes = np.array([[0.1, 0.2, 0.8, 0.7], [0.2, 0, 1, 0.6]]).astype("float32") + boxes = np.random.uniform(size=(2, 4)).astype("float32") box_indices = np.array([1, 0]).astype("int32") crop_size = np.array([20, 30]).astype("int32") elif layout == "NCHW": img_shape = (5, 3, 255, 255) - boxes = np.array([[0, 0, 1, 1], [0.2, 0.1, 1, 0.9]]).astype("float32") + boxes = np.random.uniform(size=(2, 4)).astype("float32") box_indices = np.array([0, 1]).astype("int32") crop_size = np.array([30, 30]).astype("int32") else: