Skip to content

Commit b5e79f9

Browse files
author
Josh Fromm
committed
Add test against golden array.
1 parent 7ef2fb7 commit b5e79f9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/python/frontend/onnx/test_forward.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4913,6 +4913,24 @@ def test_random_uniform():
49134913
vals_2 = get_random_uniform(shape=[10], seed=1)
49144914
assert all(vals_1 == vals_2)
49154915

4916+
# Test against an expected output with a fixed seed.
4917+
real = get_random_uniform(shape=[10], seed=5)
4918+
expected = np.asarray(
4919+
[
4920+
0.8614111,
4921+
0.46572232,
4922+
0.6007328,
4923+
0.21619737,
4924+
0.6361222,
4925+
0.7298056,
4926+
0.13094282,
4927+
0.03556716,
4928+
0.32997167,
4929+
0.2977605,
4930+
]
4931+
)
4932+
tvm.testing.assert_allclose(real, expected, rtol=1e-5)
4933+
49164934

49174935
if __name__ == "__main__":
49184936
test_flatten()

0 commit comments

Comments
 (0)