From 5efecaf1a1ff2b2ac1fd3a6659e369e62d53f7c9 Mon Sep 17 00:00:00 2001 From: Peter Hawkins Date: Thu, 14 Jan 2021 09:48:06 -0800 Subject: [PATCH] [XLA:Python] Fix assertion failure in debug mode. PiperOrigin-RevId: 351819163 Change-Id: I4b32ee9d5abba389b5ee1ef3718caac6510cc0ec --- tensorflow/compiler/xla/python/xla_client_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/compiler/xla/python/xla_client_test.py b/tensorflow/compiler/xla/python/xla_client_test.py index ba398f6b7ca..bd4bece0c40 100644 --- a/tensorflow/compiler/xla/python/xla_client_test.py +++ b/tensorflow/compiler/xla/python/xla_client_test.py @@ -1984,7 +1984,7 @@ def TestFactory(xla_backend, cloud_tpu=False): self.assertEqual(type(dlt).__name__, "PyCapsule") y = xla_client._xla.dlpack_managed_tensor_to_buffer(dlt, self.backend) np.testing.assert_array_equal( - x.astype(np.uint8) if x == np.bool_ else x, y.to_py()) + x.astype(np.uint8) if dtype == np.bool_ else x, y.to_py()) def testTensorsCanBeConsumedOnceOnly(self): x = np.array(np.random.rand(3, 4, 5, 6), dtype=np.float32)