Skip to content

Commit 2793639

Browse files
authored
Remove Tensor.data attribute from tutorial (#3193)
1 parent 7262c21 commit 2793639

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

beginner_source/blitz/cifar10_tutorial.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def forward(self, x):
252252
# calculate outputs by running images through the network
253253
outputs = net(images)
254254
# the class with the highest energy is what we choose as prediction
255-
_, predicted = torch.max(outputs.data, 1)
255+
_, predicted = torch.max(outputs, 1)
256256
total += labels.size(0)
257257
correct += (predicted == labels).sum().item()
258258

0 commit comments

Comments
 (0)