Skip to content

Commit

Permalink
Optimize DataLoader iteration in WrappedDataLoader (#2375)
Browse files Browse the repository at this point in the history
  • Loading branch information
HemanthSai7 authored Jun 1, 2023
1 parent e2a7ab0 commit e1ec4bd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions beginner_source/nn_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e1ec4bd

Please sign in to comment.