Disable XLA:CPU fast math on some tests needing infinities.

PiperOrigin-RevId: 300747481
Change-Id: I53ae5308d4c0a0945f9e37d4e42586e9d8d64f25
This commit is contained in:
Tres Popp 2020-03-13 06:53:10 -07:00 committed by TensorFlower Gardener
parent 12ac62636b
commit 960e0d8ea8
2 changed files with 11 additions and 0 deletions

View File

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

View File

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