def _testCpuMatmul(self, x, y, transpose_x=False, transpose_y=False):
    x_mat = (np.matrix(x).T if transpose_x else np.matrix(x))
    y_mat = (np.matrix(y).T if transpose_y else np.matrix(y))
    np_ans = (x_mat * y_mat)
    with self.test_session(use_gpu=False):
        tf_ans = tf.matmul(x, y, transpose_x, transpose_y).eval()
    self.assertAllClose(np_ans, tf_ans)
    self.assertAllEqual(np_ans.shape, tf_ans.shape)
def _testCpuMatmul(self, x, y, transpose_x=False, transpose_y=False):
    x_mat = (np.matrix(x).T if transpose_x else np.matrix(x))
    y_mat = (np.matrix(y).T if transpose_y else np.matrix(y))
    np_ans = (x_mat * y_mat)
    with self.test_session(use_gpu=False):
        tf_ans = tf.matmul(x, y, transpose_x, transpose_y).eval()
    self.assertAllClose(np_ans, tf_ans)
    self.assertAllEqual(np_ans.shape, tf_ans.shape)