MCPcopy Create free account
hub / github.com/adobe-research/custom-diffusion / WrappedDataset

Class WrappedDataset

train.py:315–325  ·  view source on GitHub ↗

Wraps an arbitrary object with __len__ and __getitem__ into a pytorch dataset

Source from the content-addressed store, hash-verified

313
314
315class WrappedDataset(Dataset):
316 """Wraps an arbitrary object with __len__ and __getitem__ into a pytorch dataset"""
317
318 def __init__(self, dataset):
319 self.data = dataset
320
321 def __len__(self):
322 return len(self.data)
323
324 def __getitem__(self, idx):
325 return self.data[idx]
326
327
328def worker_init_fn(_):

Callers 1

setupMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected