octoJon commented on code in PR #12284:
URL: https://github.com/apache/tvm/pull/12284#discussion_r936918746


##########
tests/python/topi/python/test_topi_prng.py:
##########
@@ -157,8 +185,27 @@ def test_uniform(target, dev):
         assert np.max(rands) <= 10.0
 
 
+@tvm.testing.parametrize_targets
+def test_multinomial(target, dev):
+    def _verify_multinomial(size, num_samples):

Review Comment:
   You could generate a "large" sample of at least 10,000 values and then use a 
chi-squared test (scipy.stats.chisquare). You'd look at the p-value from that 
chi-squared test and compare it to an acceptably low threshold for flakiness -- 
for example, have this unit test fail if the p-value is smaller than 1e-6, 
which should only happen by chance in one run per million.



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to