b0a156d87b736d90c3e27933e8e4d0114bd5ef36,demo.py,,train_epoch,#,30
Before Change
input_var = torch.autograd.Variable(input.cuda(async=True))
target_var = torch.autograd.Variable(target.cuda(async=True))
else:
input_var = torch.autograd.Variable(input)
target_var = torch.autograd.Variable(target)
// compute output
output = model(input_var)
After Change
// Create vaiables
if torch.cuda.is_available():
input = input.cuda()
target = target.cuda()
// compute output
output = model(input)
loss = torch.nn.functional.cross_entropy(output, target)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: gpleiss/efficient_densenet_pytorch
Commit Name: b0a156d87b736d90c3e27933e8e4d0114bd5ef36
Time: 2019-01-27
Author: gpleiss@gmail.com
File Name: demo.py
Class Name:
Method Name: train_epoch
Project Name: gpleiss/efficient_densenet_pytorch
Commit Name: b0a156d87b736d90c3e27933e8e4d0114bd5ef36
Time: 2019-01-27
Author: gpleiss@gmail.com
File Name: demo.py
Class Name:
Method Name: test_epoch
Project Name: mapillary/inplace_abn
Commit Name: 5c28a8708b9662668a4a6f4c78bcf0a215eb9e87
Time: 2018-07-17
Author: lorenzo@mapillary.com
File Name: train_imagenet.py
Class Name:
Method Name: train