3d054be72e81af7acb1109028d7be4fceebae720,train.py,,test,#Any#Any#Any#,58
Before Change
S2 = S2.cuda()
labels = labels.cuda()
// Wrap to autograd.Variable
X, S1, S2 = Variable(X) , Variable(S1), Variable(S2)
// Forward pass
outputs, predictions = net(X, S1, S2, config)
// Select actions with max scores(logits)
After Change
if X.size()[0] != config.batch_size:
continue // Drop those data, if not enough for a batch
// automaticlly select device, device agnostic
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu" )
X = X.to(device)
S1 = S1.to(device)
S2 = S2.to(device)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: kentsommer/pytorch-value-iteration-networks
Commit Name: 3d054be72e81af7acb1109028d7be4fceebae720
Time: 2019-12-31
Author: kelvinson@foxmail.com
File Name: train.py
Class Name:
Method Name: test
Project Name: pytorch/tutorials
Commit Name: 0ad33d606682537466f3430fc6d6ac7d47460f1a
Time: 2018-04-24
Author: soumith@gmail.com
File Name: beginner_source/blitz/cifar10_tutorial.py
Class Name:
Method Name:
Project Name: kengz/SLM-Lab
Commit Name: 7feec508898d1886a8ca361a85b8613328177e25
Time: 2018-03-09
Author: lgraesser@users.noreply.github.com
File Name: slm_lab/agent/net/recurrent.py
Class Name: RecurrentNet
Method Name: init_hidden