4c57c23e138e8b26427337d67536d4e239d55e06,tensor_train_test.py,TensorTrainTest,testValidateTTCores2d,#TensorTrainTest#,11

Before Change


                ((1, 2, 1, 1), False))

    for ranks, desired in schedule:
      a = np.random.rand(ranks[0], 10, ranks[1]).astype(np.float32)
      b = np.random.rand(ranks[2], 9, ranks[3]).astype(np.float32)
      with self.test_session():
        self.assertEqual(desired, tensor_train._are_tt_cores_valid((a, b)))
        if desired:
          tf_tens = tensor_train.TensorTrain((a, b))
          tf_cores = tf_tens.tt_cores
          self.assertEqual(desired, tensor_train._are_tt_cores_valid(tf_cores))
        else:
          with self.assertRaises(ValueError):
            tensor_train.TensorTrain((a, b))

After Change


      with self.test_session():
        actual = tensor_train._are_tt_cores_valid((a, b), (10, 9),
                                                  claimed_tt_ranks)
        self.assertEqual(desired, actual)
        // Wrong shape.
        actual = tensor_train._are_tt_cores_valid((a, b), (9, 9),
                                                  claimed_tt_ranks)
        self.assertEqual(False, actual)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: Bihaqo/t3f
Commit Name: 4c57c23e138e8b26427337d67536d4e239d55e06
Time: 2017-02-03
Author: novikov@bayesgroup.ru
File Name: tensor_train_test.py
Class Name: TensorTrainTest
Method Name: testValidateTTCores2d


Project Name: CSAILVision/semantic-segmentation-pytorch
Commit Name: 71c559e66eaff89089fa447a3d7e04b6835356cf
Time: 2019-08-02
Author: zhaohang0124@gmail.com
File Name: dataset.py
Class Name: ValDataset
Method Name: __getitem__


Project Name: nipy/dipy
Commit Name: 1907a85666ff47cfb7a51fd6ecdb82050b38ec76
Time: 2020-11-16
Author: shreyasfadnavis@gmail.com
File Name: dipy/denoise/tests/test_patch2self.py
Class Name:
Method Name: test_patch2self_random_noise


Project Name: catalyst-team/catalyst
Commit Name: 1ef3ad90a3423ed15ca41e0ea4e81012ebe84a9f
Time: 2020-08-11
Author: scitator@gmail.com
File Name: catalyst/data/scripts/project_embeddings.py
Class Name:
Method Name: main