Skip to content

Commit

Permalink
intro to pytorch: Part 2, next() is not a method
Browse files Browse the repository at this point in the history
  • Loading branch information
VadimPushtaev committed Feb 28, 2023
1 parent c9404fc commit ff29fe7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@
"source": [
"# Grab some data \n",
"dataiter = iter(trainloader)\n",
"images, labels = dataiter.next()\n",
"images, labels = next(dataiter)\n",
"\n",
"# Resize images into a 1D vector, new shape is (batch size, color channels, image pixels) \n",
"images.resize_(64, 1, 784)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
],
"source": [
"dataiter = iter(trainloader)\n",
"images, labels = dataiter.next()\n",
"images, labels = next(dataiter)\n",
"print(type(images))\n",
"print(images.shape)\n",
"print(labels.shape)"
Expand Down

0 comments on commit ff29fe7

Please sign in to comment.