8d0f7cb1babdbcedf7669f2dfddc88cd4c030167,test/experimental/test_vectors.py,TestVectors,test_vectors_load_and_save,#TestVectors#,100
Before Change
expected_unk_tensor = torch.tensor([0, 0], dtype=torch.float)
tokens = ["a"]
vectors = tensorA.unsqueeze(0)
vectors_obj = Vectors(tokens, vectors)
vector_path = os.path.join(self.test_dir, "vectors.pt")
torch.save(vectors_obj, vector_path)
After Change
def test_vectors_load_and_save(self):
tensorA = torch.tensor([1, 0], dtype=torch.float)
tensorB = torch.tensor([0, 1], dtype=torch.float)
expected_unk_tensor = torch.tensor([0, 0], dtype=torch.float)
tokens = ["a", "b"]
vectors = torch.stack((tensorA, tensorB), 0)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: pytorch/text
Commit Name: 8d0f7cb1babdbcedf7669f2dfddc88cd4c030167
Time: 2020-08-01
Author: 22487263+Nayef211@users.noreply.github.com
File Name: test/experimental/test_vectors.py
Class Name: TestVectors
Method Name: test_vectors_load_and_save
Project Name: dmlc/dgl
Commit Name: 174dd18905f12bfe0b418a4bad3575e6331478a4
Time: 2021-02-22
Author: expye@outlook.com
File Name: python/dgl/nn/pytorch/glob.py
Class Name: MultiHeadAttention
Method Name: forward
Project Name: pytorch/text
Commit Name: 8d0f7cb1babdbcedf7669f2dfddc88cd4c030167
Time: 2020-08-01
Author: 22487263+Nayef211@users.noreply.github.com
File Name: test/experimental/test_vectors.py
Class Name: TestVectors
Method Name: test_vectors_load_and_save
Project Name: pytorch/pytorch
Commit Name: 7e4c95695539c0fe0675ab0c91de761247143d8a
Time: 2021-01-27
Author: bowbao@microsoft.com
File Name: torch/onnx/symbolic_helper.py
Class Name:
Method Name: _unsqueeze_helper