diff --git a/beginner_source/blitz/cifar10_tutorial.py b/beginner_source/blitz/cifar10_tutorial.py index f38abdd566..39dee47962 100644 --- a/beginner_source/blitz/cifar10_tutorial.py +++ b/beginner_source/blitz/cifar10_tutorial.py @@ -252,7 +252,7 @@ def forward(self, x): # calculate outputs by running images through the network outputs = net(images) # the class with the highest energy is what we choose as prediction - _, predicted = torch.max(outputs.data, 1) + _, predicted = torch.max(outputs, 1) total += labels.size(0) correct += (predicted == labels).sum().item()