File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
tutorials/01-basics/feedforward_neural_network Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ def forward(self, x):
57
57
for epoch in range (num_epochs ):
58
58
for i , (images , labels ) in enumerate (train_loader ):
59
59
# Convert torch tensor to Variable
60
- images = Variable (images .view (- 1 , 28 * 28 )) .cuda ()
61
- labels = Variable (labels ) .cuda ()
60
+ images = Variable (images .view (- 1 , 28 * 28 ).cuda () )
61
+ labels = Variable (labels .cuda () )
62
62
63
63
# Forward + Backward + Optimize
64
64
optimizer .zero_grad () # zero the gradient buffer
@@ -84,4 +84,4 @@ def forward(self, x):
84
84
print ('Accuracy of the network on the 10000 test images: %d %%' % (100 * correct / total ))
85
85
86
86
# Save the Model
87
- torch .save (net .state_dict (), 'model.pkl' )
87
+ torch .save (net .state_dict (), 'model.pkl' )
You can’t perform that action at this time.
0 commit comments