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


path = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(path, "..", "data", "Cora")
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()
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: kymatio/kymatio
Commit Name: 4f91cb1bfab978c05a30de8a70e36426aaa19df5
Time: 2018-11-21
Author: janden@flatironinstitute.org
File Name: examples/3d/compute_speed.py
Class Name:
Method Name:


Project Name: inferno-pytorch/inferno
Commit Name: 45ca429994196d479bef22edbbf36dc9698350d2
Time: 2018-12-19
Author: steffen.wolf@iwr.uni-heidelberg.de
File Name: tests/test_utils/test_model_utils.py
Class Name: ModelUtilTester
Method Name: test_model_tester_cuda


Project Name: zhirongw/lemniscate.pytorch
Commit Name: 5415d0eac12bf6031772eab8d08fbdebd107bb0a
Time: 2018-07-26
Author: xavibrowu@gmail.com
File Name: test.py
Class Name:
Method Name: kNN