Skip to content

Commit d6aa1f0

Browse files
ShishirPatilsoumith
authored andcommitted
moving input data to device (#487)
1 parent b4cd127 commit d6aa1f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

beginner_source/blitz/cifar10_tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def forward(self, x):
160160

161161
running_loss = 0.0
162162
for i, data in enumerate(trainloader, 0):
163-
# get the inputs
163+
# get the inputs; data is a list of [inputs, labels]
164164
inputs, labels = data
165165

166166
# zero the parameter gradients
@@ -295,7 +295,7 @@ def forward(self, x):
295295
#
296296
# .. code:: python
297297
#
298-
# inputs, labels = inputs.to(device), labels.to(device)
298+
# inputs, labels = data[0].to(device), data[1].to(device)
299299
#
300300
# Why dont I notice MASSIVE speedup compared to CPU? Because your network
301301
# is realllly small.

0 commit comments

Comments
 (0)