You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by wk...@apache.org on 2019/03/21 03:40:01 UTC
[incubator-mxnet] branch master updated: Fixes
test_operator_gpu.test_multinomial_generator (#14475)
This is an automated email from the ASF dual-hosted git repository.
wkcn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new a01bdee Fixes test_operator_gpu.test_multinomial_generator (#14475)
a01bdee is described below
commit a01bdee4beafd1a5caf0cf11be492879ebce417d
Author: Jake Lee <gs...@gmail.com>
AuthorDate: Thu Mar 21 11:39:29 2019 +0800
Fixes test_operator_gpu.test_multinomial_generator (#14475)
* adjust the success rate
* add comments
---
tests/python/unittest/test_random.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/python/unittest/test_random.py b/tests/python/unittest/test_random.py
index d1340c4..2f5aad2 100644
--- a/tests/python/unittest/test_random.py
+++ b/tests/python/unittest/test_random.py
@@ -641,15 +641,20 @@ def test_multinomial_generator():
quantized_probs = quantize_probs(probs, dtype)
generator_mx = lambda x: mx.nd.random.multinomial(data=mx.nd.array(quantized_probs, ctx=ctx, dtype=dtype),
shape=x).asnumpy()
+ # success_rate was set to 0.15 since PR #13498 and became flaky
+ # both of previous issues(#14457, #14158) failed with success_rate 0.25
+ # In func verify_generator inside test_utilis.py
+ # it raise the error when success_num(1) < nrepeat(5) * success_rate(0.25)
+ # by changing the 0.25 -> 0.2 solve these edge case but still have strictness
verify_generator(generator=generator_mx, buckets=buckets, probs=quantized_probs,
- nsamples=samples, nrepeat=trials)
+ nsamples=samples, nrepeat=trials, success_rate=0.20)
generator_mx_same_seed = \
lambda x: np.concatenate(
[mx.nd.random.multinomial(data=mx.nd.array(quantized_probs, ctx=ctx, dtype=dtype),
shape=x // 10).asnumpy()
for _ in range(10)])
verify_generator(generator=generator_mx_same_seed, buckets=buckets, probs=quantized_probs,
- nsamples=samples, nrepeat=trials)
+ nsamples=samples, nrepeat=trials, success_rate=0.20)
@with_seed()