diff --git a/tensorflow/compiler/tests/binary_ops_test.py b/tensorflow/compiler/tests/binary_ops_test.py index f42d51dbb3a..8543e8ea2be 100644 --- a/tensorflow/compiler/tests/binary_ops_test.py +++ b/tensorflow/compiler/tests/binary_ops_test.py @@ -19,6 +19,7 @@ from __future__ import division from __future__ import print_function import itertools +import os import numpy as np @@ -1600,4 +1601,8 @@ class BinaryOpsTest(xla_test.XLATestCase): if __name__ == "__main__": + # TODO(b/130689556): XLA CPU does not honor inf/nan which causes problems + os.environ[ + "XLA_FLAGS"] = "--xla_cpu_enable_fast_math=false " + os.environ.get( + "XLA_FLAGS", "") googletest.main() diff --git a/tensorflow/python/kernel_tests/numerics_test.py b/tensorflow/python/kernel_tests/numerics_test.py index 4c77028d8fd..4d31cd45289 100644 --- a/tensorflow/python/kernel_tests/numerics_test.py +++ b/tensorflow/python/kernel_tests/numerics_test.py @@ -18,6 +18,8 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function +import os + import numpy as np from tensorflow.python.framework import constant_op @@ -177,4 +179,8 @@ class NumericsTest(test.TestCase): if __name__ == "__main__": + # TODO(b/130689556): XLA CPU does not honor inf/nan which causes problems + os.environ[ + "XLA_FLAGS"] = "--xla_cpu_enable_fast_math=false " + os.environ.get( + "XLA_FLAGS", "") test.main()