From aebf9145bd89a2c2d1b424ee543e3675977c8da4 Mon Sep 17 00:00:00 2001 From: Johann Benerradi Date: Thu, 19 Dec 2024 09:52:45 +0000 Subject: [PATCH] Remove Tensor.data attribute from tutorial --- beginner_source/blitz/cifar10_tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beginner_source/blitz/cifar10_tutorial.py b/beginner_source/blitz/cifar10_tutorial.py index f38abdd5666..39dee479626 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()