Update complex test case
authorYong Tang <yong.tang.github@outlook.com>
Wed, 18 Apr 2018 01:27:51 +0000 (01:27 +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 e0eeee1..fd71f51 100644 (file)
@@ -64,14 +64,14 @@ class PyFuncTest(test.TestCase):
         self.assertEqual(z, dtype(3))
 
   def testComplexDataTypes(self):
-    def sum_func(x, y):
-      return x + y
+    def sub_func(x, y):
+      return x - y
     for dtype in [np.complex64, np.complex128]:
       with self.test_session():
         x = constant_op.constant(1 + 1j, dtype=dtype)
-        y = constant_op.constant(2 + 2j, dtype=dtype)
-        z = self.evaluate(script_ops.py_func(sum_func, [x, y], dtype))
-        self.assertEqual(z, dtype(3 + 3j))
+        y = constant_op.constant(2 - 2j, dtype=dtype)
+        z = self.evaluate(script_ops.py_func(sub_func, [x, y], dtype))
+        self.assertEqual(z, dtype(-1 + 3j))
 
   def testSingleType(self):
     with self.test_session():