From dce6c95675edf45f9611486f9841f7bdaaaa8e99 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Tue, 30 Jul 2019 17:21:55 -0700 Subject: [PATCH] Cleanup tensorflow test for numpy 1.16 update PiperOrigin-RevId: 260829689 --- tensorflow/compiler/tests/stateful_random_ops_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tensorflow/compiler/tests/stateful_random_ops_test.py b/tensorflow/compiler/tests/stateful_random_ops_test.py index a54cd60cfd7..343969c40d7 100644 --- a/tensorflow/compiler/tests/stateful_random_ops_test.py +++ b/tensorflow/compiler/tests/stateful_random_ops_test.py @@ -278,10 +278,11 @@ class StatefulRandomOpsTest(xla_test.XLATestCase, parameterized.TestCase): maxval = 1 if dtype.is_integer: maxval = 100 - x = gen.uniform(shape=[n], maxval=maxval, dtype=dtype).numpy() + t = gen.uniform(shape=[n], maxval=maxval, dtype=dtype) + x = t.numpy().astype(float) if maxval > 1: # Normalize y to range [0, 1). - x = x.astype(float) / maxval + x = x / maxval # Tests that the values are distributed amongst 10 bins with equal # probability. 16.92 is the Chi^2 value for 9 degrees of freedom with # p=0.05. This test is probabilistic and would be flaky if the random