Skip to content

Commit ff29fe7

Browse files
committed
intro to pytorch: Part 2, next() is not a method
1 parent c9404fc commit ff29fe7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

intro-to-pytorch/Part 2 - Neural Networks in PyTorch (Exercises).ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@
452452
"source": [
453453
"# Grab some data \n",
454454
"dataiter = iter(trainloader)\n",
455-
"images, labels = dataiter.next()\n",
455+
"images, labels = next(dataiter)\n",
456456
"\n",
457457
"# Resize images into a 1D vector, new shape is (batch size, color channels, image pixels) \n",
458458
"images.resize_(64, 1, 784)\n",

intro-to-pytorch/Part 2 - Neural Networks in PyTorch (Solution).ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
],
113113
"source": [
114114
"dataiter = iter(trainloader)\n",
115-
"images, labels = dataiter.next()\n",
115+
"images, labels = next(dataiter)\n",
116116
"print(type(images))\n",
117117
"print(images.shape)\n",
118118
"print(labels.shape)"

0 commit comments

Comments
 (0)