Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

FIX: flaky test exponential generator #14287

Merged
merged 2 commits into from
Mar 4, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/python/unittest/test_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,12 +560,12 @@ def test_exponential_generator():
for scale in [0.1, 1.0]:
buckets, probs = gen_buckets_probs_with_ppf(lambda x: ss.expon.ppf(x, loc=0, scale=scale), 5)
generator_mx = lambda x: mx.nd.random.exponential(scale, shape=x, ctx=ctx, dtype=dtype).asnumpy()
verify_generator(generator=generator_mx, buckets=buckets, probs=probs)
verify_generator(generator=generator_mx, buckets=buckets, probs=probs, success_rate=0.20)
generator_mx_same_seed = \
lambda x: np.concatenate(
[mx.nd.random.exponential(scale, shape=x // 10, ctx=ctx, dtype=dtype).asnumpy()
for _ in range(10)])
verify_generator(generator=generator_mx_same_seed, buckets=buckets, probs=probs)
verify_generator(generator=generator_mx_same_seed, buckets=buckets, probs=probs, success_rate=0.20)

@with_seed()
def test_poisson_generator():
Expand Down