def test_MatMul(self):
t = tf.matmul(*self.random((4, 3), (3, 5)), transpose_a=False, transpose_b=False)
self.check(t)
t = tf.matmul(*self.random((3, 4), (3, 5)), transpose_a=True, transpose_b=False)
self.check(t)
t = tf.matmul(*self.random((4, 3), (5, 3)), transpose_a=False, transpose_b=True)
self.check(t)
t = tf.matmul(*self.random((3, 4), (5, 3)), transpose_a=True, transpose_b=True)
self.check(t)
# def test_BatchMatMul(self):
# t = tf.batch_matmul(*self.random((2, 4, 4, 3), (2, 4, 3, 5)), adj_x=False, adj_y=False)
# self.check(t)
# t = tf.batch_matmul(*self.random((2, 4, 3, 4), (2, 4, 3, 5)), adj_x=True, adj_y=False)
# self.check(t)
# t = tf.batch_matmul(*self.random((2, 4, 4, 3), (2, 4, 5, 3)), adj_x=False, adj_y=True)
# self.check(t)
# t = tf.batch_matmul(*self.random((2, 4, 3, 4), (2, 4, 5, 3)), adj_x=True, adj_y=True)
# self.check(t)
评论列表
文章目录