From bdb77d1e2e755fb7a3aa5614a16bbc7fe152b64a Mon Sep 17 00:00:00 2001 From: Gunhan Gulsoy Date: Tue, 17 Mar 2020 10:50:24 -0700 Subject: [PATCH] Work around the following bug in python 3.8 OverflowError: Python int too large to convert to C long On windows, sizeof(long) is 4 bytes. Therefore, the large integers seem to be a problem when backed by some numpy types: https://stackoverflow.com/questions/38314118/overflowerror-python-int-too-large-to-convert-to-c-long-on-windows-but-not-ma PiperOrigin-RevId: 301407257 Change-Id: Ic0f7379eee360ff053283742f6495c1974b2c5e4 --- tensorflow/compiler/tests/categorical_op_test.py | 2 +- tensorflow/compiler/tests/stateless_random_ops_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow/compiler/tests/categorical_op_test.py b/tensorflow/compiler/tests/categorical_op_test.py index ef6df1f0879..afda99a7e06 100644 --- a/tensorflow/compiler/tests/categorical_op_test.py +++ b/tensorflow/compiler/tests/categorical_op_test.py @@ -187,7 +187,7 @@ class CategoricalTest(xla_test.XLATestCase): 0, seed=seed_t, output_dtype=dtypes.int32) - y = sess.run(x, {seed_t: [0x12345678, 0xabcdef12]}) + y = sess.run(x, {seed_t: [0x12345678, 0xabcdef1]}) self.assertEqual(y.shape, (42, 0)) diff --git a/tensorflow/compiler/tests/stateless_random_ops_test.py b/tensorflow/compiler/tests/stateless_random_ops_test.py index 6576e274300..56b49689607 100644 --- a/tensorflow/compiler/tests/stateless_random_ops_test.py +++ b/tensorflow/compiler/tests/stateless_random_ops_test.py @@ -101,7 +101,7 @@ class StatelessRandomOpsTest(xla_test.XLATestCase): seed_t = array_ops.placeholder(dtypes.int32, shape=[2]) x = stateless.stateless_random_normal( shape=[10000], seed=seed_t, dtype=dtype) - y = sess.run(x, {seed_t: [0x12345678, 0xabcdef12]}) + y = sess.run(x, {seed_t: [0x12345678, 0xabcdef1]}) self.assertTrue(np.all(np.isfinite(y))) def testDistributionOfStatelessRandomNormal(self):