@@ -0,0 +1,863 @@
+import numpy as np%0Aimport tensorflow as tf%0A%0Afrom tensor_train import TensorTrain%0Afrom tensor_train_batch import TensorTrainBatch%0Aimport ops%0Aimport batch_ops%0Aimport initializers%0A%0A%0Aclass BatchOpsTest(tf.test.TestCase):%0A%0A  def testGramMatrix(self):%0A    np.random.seed(1)%0A    tt_vectors = initializers.random_matrix_batch(((2, 3), None), batch_size=5)%0A    res_actual = batch_ops.gram_matrix(tt_vectors)%0A    full_vectors = tf.reshape(ops.full(tt_vectors), (5, 6))%0A    print(full_vectors.get_shape())%0A    res_desired = tf.matmul(full_vectors, tf.transpose(full_vectors))%0A    res_desired = tf.squeeze(res_desired)%0A    # print(res_desired.get_shape())%0A    with self.test_session() as sess:%0A      res_actual_val, res_desired_val = sess.run((res_actual, res_desired))%0A      self.assertAllClose(res_desired_val, res_actual_val)%0A%0Aif __name__ == %22__main__%22:%0A  tf.test.main()%0A%0A

Test Gram matrix