d477e70d888d8501cc0834c47f399a4f65a439d9,senteval/tools/classifier.py,PyTorchClassifier,trainepoch,#PyTorchClassifier#Any#Any#Any#,90

Before Change


            all_costs = []
            for i in range(0, len(X), self.batch_size):
                // forward
                idx = torch.LongTensor(permutation[i:i + self.batch_size])
                if isinstance(X, torch.cuda.FloatTensor):
                    idx = idx.cuda()
                Xbatch = Variable(X.index_select(0, idx))
                ybatch = Variable(y.index_select(0, idx))

After Change


            all_costs = []
            for i in range(0, len(X), self.batch_size):
                // forward
                idx = torch.from_numpy(permutation[i:i + self.batch_size]).long().to(X.device)

                Xbatch = X[idx]
                ybatch = y[idx]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: facebookresearch/SentEval
Commit Name: d477e70d888d8501cc0834c47f399a4f65a439d9
Time: 2018-07-13
Author: asabran@fb.com
File Name: senteval/tools/classifier.py
Class Name: PyTorchClassifier
Method Name: trainepoch


Project Name: elbayadm/attn2d
Commit Name: 9ca82a0ee650c17c1d008c8fbf2a2fcae2912b41
Time: 2018-12-18
Author: aimeeli@fb.com
File Name: fairseq/data/token_block_dataset.py
Class Name: TokenBlockDataset
Method Name: __getitem__