430beec651fe14e4f0f032cbc27e18a9ca415d90,examples/cora.py,,,#,11
Before Change
dataset = Cora(path, transform=transform)
data = dataset[0]
input, adj, target = data["input"], data["adj"], data["target"]
n = adj.size(0)
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():
After Change
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()
class Net(nn.Module):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
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: pytorch/fairseq
Commit Name: fba10af9db5edd61f78ccdb9d115c4eafbcc561d
Time: 2020-02-14
Author: chenliu8@fb.com
File Name: fairseq/search.py
Class Name: Search
Method Name: _init_buffers