Cleanup tensorflow test for numpy 1.16 update

PiperOrigin-RevId: 260829689
This commit is contained in:
A. Unique TensorFlower 2019-07-30 17:21:55 -07:00 committed by TensorFlower Gardener
parent 25a15dda8e
commit dce6c95675

View File

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