Fix flakyness, sometimes the op takes ms to run.

PiperOrigin-RevId: 165728705
This commit is contained in:
A. Unique TensorFlower
2017-08-18 11:18:09 -07:00
committed by TensorFlower Gardener
parent 360bff8ae5
commit e6c60fb368

View File

@@ -95,7 +95,7 @@ class PrintModelAnalysisTest(test.TestCase):
# Make sure time is profiled.
gap = 1 if test.is_gpu_available() else 2
for i in range(3, 6, gap):
mat = re.search('(.*)us/(.*)us', metrics[i])
mat = re.search('(.*)[um]s/(.*)[um]s', metrics[i])
self.assertGreater(float(mat.group(1)), 0.0)
self.assertGreater(float(mat.group(2)), 0.0)
# Make sure device is profiled.