diff --git a/beginner_source/nn_tutorial.py b/beginner_source/nn_tutorial.py index 7ee7df3b43..183aca1748 100644 --- a/beginner_source/nn_tutorial.py +++ b/beginner_source/nn_tutorial.py @@ -795,8 +795,7 @@ def __len__(self): return len(self.dl) def __iter__(self): - batches = iter(self.dl) - for b in batches: + for b in self.dl: yield (self.func(*b)) train_dl, valid_dl = get_data(train_ds, valid_ds, bs)