430beec651fe14e4f0f032cbc27e18a9ca415d90,examples/cora.py,,,#,11

Before Change


train_mask = torch.arange(0, n - 1000, out=torch.LongTensor())
test_mask = torch.arange(n - 500, n, out=torch.LongTensor())

if torch.cuda.is_available():
    input, adj, target = input.cuda(), adj.cuda(), target.cuda()
    train_mask, test_mask = train_mask.cuda(), test_mask.cuda()

input, target = Variable(input), Variable(target)


class Net(nn.Module):

After Change


dataset = Cora(path, transform=TargetIndegreeAdj())
data = dataset[0].cuda().to_variable()
train_mask = torch.arange(0, data.num_nodes - 1000).long()
test_mask = torch.arange(data.num_nodes - 500, data.num_nodes).long()


class Net(nn.Module):
    def __init__(self):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: rusty1s/pytorch_geometric
Commit Name: 430beec651fe14e4f0f032cbc27e18a9ca415d90
Time: 2018-03-06
Author: matthias.fey@tu-dortmund.de
File Name: examples/cora.py
Class Name:
Method Name:


Project Name: facebookresearch/end-to-end-negotiator
Commit Name: 1009c633783cbdc571ea34aaaa477ef438afbb40
Time: 2019-02-18
Author: denisyarats@gmail.com
File Name: src/agent.py
Class Name: LstmAgent
Method Name: _encode


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: mozilla/TTS
Commit Name: 0f8936d7440b78581987e7f80bb7fa5d4c96c98d
Time: 2019-06-12
Author: egolge@mozilla.com
File Name: utils/synthesis.py
Class Name:
Method Name: synthesis