MCPcopy Index your code
hub / github.com/pytorch/tutorials / WrappedDataLoader

Class WrappedDataLoader

beginner_source/nn_tutorial.py:789–799  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

787
788
789class WrappedDataLoader:
790 def __init__(self, dl, func):
791 self.dl = dl
792 self.func = func
793
794 def __len__(self):
795 return len(self.dl)
796
797 def __iter__(self):
798 for b in self.dl:
799 yield (self.func(*b))
800
801train_dl, valid_dl = get_data(train_ds, valid_ds, bs)
802train_dl = WrappedDataLoader(train_dl, preprocess)

Callers 1

nn_tutorial.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected