def testNpVersion(self):
    x = np.array([0.0, 1.0, 2.0, 3.0]).reshape([1, 2, 2])
    y = np.array([1.0, 2.0, 3.0, 4.0]).reshape([1, 2, 2])
    z0 = self._npBatchMatmul(x, y, False, False)
    z1 = np.array([3.0, 4.0, 11.0, 16.0]).reshape([1, 2, 2])
    self.assertTrue(np.array_equal(z0, z1))
    x = np.array([1.0, 1j, (- 1.0), (- 1j)]).reshape([1, 2, 2])
    y = (x * np.complex(1, 1))
    z0 = self._npBatchMatmul(x, y, False, False)
    z1 = np.array([2.0, 2j, (- 2.0), (- 2j)]).reshape([1, 2, 2])
    self.assertTrue(np.array_equal(z0, z1))
    z0 = self._npBatchMatmul(x, y, False, True)
    z1 = np.array([(2.0 - 2j), ((- 2.0) + 2j), ((- 2.0) + 2j), (2.0 - 2j)]).reshape([1, 2, 2])
    self.assertTrue(np.array_equal(z0, z1))
    z0 = self._npBatchMatmul(x, y, True, False)
    z1 = np.array([(2.0 + 2j), ((- 2.0) + 2j), (2.0 - 2j), (2.0 + 2j)]).reshape([1, 2, 2])
    self.assertTrue(np.array_equal(z0, z1))
def testNpVersion(self):
    x = np.array([0.0, 1.0, 2.0, 3.0]).reshape([1, 2, 2])
    y = np.array([1.0, 2.0, 3.0, 4.0]).reshape([1, 2, 2])
    z0 = self._npBatchMatmul(x, y, False, False)
    z1 = np.array([3.0, 4.0, 11.0, 16.0]).reshape([1, 2, 2])
    self.assertTrue(np.array_equal(z0, z1))
    x = np.array([1.0, 1j, (- 1.0), (- 1j)]).reshape([1, 2, 2])
    y = (x * np.complex(1, 1))
    z0 = self._npBatchMatmul(x, y, False, False)
    z1 = np.array([2.0, 2j, (- 2.0), (- 2j)]).reshape([1, 2, 2])
    self.assertTrue(np.array_equal(z0, z1))
    z0 = self._npBatchMatmul(x, y, False, True)
    z1 = np.array([(2.0 - 2j), ((- 2.0) + 2j), ((- 2.0) + 2j), (2.0 - 2j)]).reshape([1, 2, 2])
    self.assertTrue(np.array_equal(z0, z1))
    z0 = self._npBatchMatmul(x, y, True, False)
    z1 = np.array([(2.0 + 2j), ((- 2.0) + 2j), (2.0 - 2j), (2.0 + 2j)]).reshape([1, 2, 2])
    self.assertTrue(np.array_equal(z0, z1))