b8be1ed0e949d11310fbea50730d470ad2bb7859,t3f/ops_test.py,TTMatrixTest,testCastIntFloat,#TTMatrixTest#,334
Before Change
K_3 = np.random.randint(0, high=100, size=(2, 2, 2, 1))
tt_int = TensorTrain([K_1, K_2, K_3], tt_ranks=[1, 2, 2, 1])
for dtype in [tf.float16, tf.float32, tf.float64]:
self.assertEqual(ops.cast(tt_int, dtype).dtype, dtype)
def testUnknownRanksTTMatmul(self):
// Tests tt_tt_matmul for matrices with unknown ranks
K_1 = tf.placeholder(tf.float32, (1, 2, 2, None))
K_2 = tf.placeholder(tf.float32, (None, 3, 3, 1))
After Change
K_3 = np.random.randint(0, high=100, size=(2, 2, 2, 1))
tt_int = TensorTrain([K_1, K_2, K_3], tt_ranks=[1, 2, 2, 1])
with self.test_session() as sess:
for dtype in [tf.float16, tf.float32, tf.float64]:
casted = ops.cast(tt_int, dtype)
casted_val = sess.run(ops.full(casted))
self.assertEqual(dtype, casted.dtype)
self.assertTrue(dtype, casted_val.dtype)
def testUnknownRanksTTMatmul(self):
// Tests tt_tt_matmul for matrices with unknown ranks
K_1 = tf.placeholder(tf.float32, (1, 2, 2, None))
K_2 = tf.placeholder(tf.float32, (None, 3, 3, 1))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 15
Instances
Project Name: Bihaqo/t3f
Commit Name: b8be1ed0e949d11310fbea50730d470ad2bb7859
Time: 2017-04-02
Author: novikov@bayesgroup.ru
File Name: t3f/ops_test.py
Class Name: TTMatrixTest
Method Name: testCastIntFloat
Project Name: Bihaqo/t3f
Commit Name: b8be1ed0e949d11310fbea50730d470ad2bb7859
Time: 2017-04-02
Author: novikov@bayesgroup.ru
File Name: t3f/ops_test.py
Class Name: TTMatrixTestBatch
Method Name: testCastIntFloat
Project Name: Bihaqo/t3f
Commit Name: b8be1ed0e949d11310fbea50730d470ad2bb7859
Time: 2017-04-02
Author: novikov@bayesgroup.ru
File Name: t3f/ops_test.py
Class Name: TTMatrixTestBatch
Method Name: testCastFloat