def _VerifyInput1(self, transpose_a, transpose_b):
    shape_x = [3, 2]
    shape_y = [2, 4]
    if transpose_a:
        shape_x = list(reversed(shape_x))
    if transpose_b:
        shape_y = list(reversed(shape_y))
    with self.test_session(use_gpu=False):
        x = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=shape_x, dtype=tf.float64, name='x')
        y = tf.constant([1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7], shape=shape_y, dtype=tf.float64, name='y')
        m = tf.matmul(x, y, transpose_a, transpose_b, name='matmul')
        err = gc.ComputeGradientError(y, shape_y, m, [3, 4])
    print('matmul input1 gradient err = ', err)
    self.assertLess(err, 1e-10)
def _VerifyInput1(self, transpose_a, transpose_b):
    shape_x = [3, 2]
    shape_y = [2, 4]
    if transpose_a:
        shape_x = list(reversed(shape_x))
    if transpose_b:
        shape_y = list(reversed(shape_y))
    with self.test_session(use_gpu=False):
        x = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=shape_x, dtype=tf.float64, name='x')
        y = tf.constant([1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7], shape=shape_y, dtype=tf.float64, name='y')
        m = tf.matmul(x, y, transpose_a, transpose_b, name='matmul')
        err = gc.ComputeGradientError(y, shape_y, m, [3, 4])
    print('matmul input1 gradient err = ', err)
    self.assertLess(err, 1e-10)