57e63487536fe9493091c4d1b011a8760c805df4,examples/shapenet.py,,train,#Any#,96

Before Change


    model.train()

    for data in train_loader:
        data = data.cuda(["input", "pos", "index", "weight", "target"])
        data = data.to_variable()
        optimizer.zero_grad()
        output = model(data.input, data.pos, data.adj)
        print(output.size())
        loss = F.nll_loss(output, data.target)
        loss.backward()

After Change


    for data in train_loader:
        data = data.cuda().to_variable()
        optimizer.zero_grad()
        output = model(data)
        loss = F.nll_loss(output, data.target)
        loss.backward()
        optimizer.step()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: rusty1s/pytorch_geometric
Commit Name: 57e63487536fe9493091c4d1b011a8760c805df4
Time: 2018-02-13
Author: matthias.fey@tu-dortmund.de
File Name: examples/shapenet.py
Class Name:
Method Name: train


Project Name: leftthomas/SRGAN
Commit Name: 1433d4c435a253e891009b08a9280bc452087db0
Time: 2017-11-21
Author: leftthomas@qq.com
File Name: test.py
Class Name:
Method Name:


Project Name: leftthomas/SRGAN
Commit Name: d6d411e49df0e130acf30d6ec21ce5c583c6a44e
Time: 2017-11-21
Author: leftthomas@qq.com
File Name: test.py
Class Name:
Method Name: