Use exponential of 2 for stability
@@ -337,7 +337,7 @@ class TestChoiceMultinomial(unittest.TestCase):
@testing.for_float_dtypes()
@testing.numpy_cupy_allclose(atol=0.02)
def test_choice_multinomial(self, xp, dtype):
- p = xp.array([0.2, 0.3, 0.5], dtype)
+ p = xp.array([0.5, 0.25, 0.125, 0.125], dtype)
trial = 10000
x = xp.random.choice(len(p), trial, p=p)
y = xp.bincount(x).astype('f') / trial
