From ff29fe705ed0ca7ac698c9db074b75652ef699dd Mon Sep 17 00:00:00 2001 From: Vadim Pushtaev Date: Tue, 28 Feb 2023 23:27:11 +0200 Subject: [PATCH] intro to pytorch: Part 2, next() is not a method --- .../Part 2 - Neural Networks in PyTorch (Exercises).ipynb | 2 +- .../Part 2 - Neural Networks in PyTorch (Solution).ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/intro-to-pytorch/Part 2 - Neural Networks in PyTorch (Exercises).ipynb b/intro-to-pytorch/Part 2 - Neural Networks in PyTorch (Exercises).ipynb index b6591c9c21..a507ec4560 100644 --- a/intro-to-pytorch/Part 2 - Neural Networks in PyTorch (Exercises).ipynb +++ b/intro-to-pytorch/Part 2 - Neural Networks in PyTorch (Exercises).ipynb @@ -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", diff --git a/intro-to-pytorch/Part 2 - Neural Networks in PyTorch (Solution).ipynb b/intro-to-pytorch/Part 2 - Neural Networks in PyTorch (Solution).ipynb index 77ba591ad1..c4f2db2b28 100644 --- a/intro-to-pytorch/Part 2 - Neural Networks in PyTorch (Solution).ipynb +++ b/intro-to-pytorch/Part 2 - Neural Networks in PyTorch (Solution).ipynb @@ -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)"