Remove unneeded for loop for bool data types in tests
authorYong Tang <yong.tang.github@outlook.com>
Wed, 18 Apr 2018 01:32:37 +0000 (01:32 +0000)
committerYong Tang <yong.tang.github@outlook.com>
Wed, 18 Apr 2018 17:37:38 +0000 (17:37 +0000)
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
tensorflow/python/kernel_tests/py_func_test.py

index 54ab5ab..7a17861 100644 (file)
@@ -76,12 +76,12 @@ class PyFuncTest(test.TestCase):
   def testBoolDataTypes(self):
     def and_func(x, y):
       return x and y
-    for dtype in [np.bool]:
-      with self.test_session():
-        x = constant_op.constant(True, dtype=dtype)
-        y = constant_op.constant(False, dtype=dtype)
-        z = self.evaluate(script_ops.py_func(and_func, [x, y], dtype))
-        self.assertEqual(z, dtype(False))
+    dtype = dtypes.bool
+    with self.test_session():
+      x = constant_op.constant(True, dtype=dtype)
+      y = constant_op.constant(False, dtype=dtype)
+      z = self.evaluate(script_ops.py_func(and_func, [x, y], dtype))
+      self.assertEqual(z, False)
 
   def testSingleType(self):
     with self.test_session():