MCPcopy Create free account
hub / github.com/IceClear/StableSR / WrappedDataset

Class WrappedDataset

main.py:135–145  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

133
134
135class WrappedDataset(Dataset):
136 """Wraps an arbitrary object with __len__ and __getitem__ into a pytorch dataset"""
137
138 def __init__(self, dataset):
139 self.data = dataset
140
141 def __len__(self):
142 return len(self.data)
143
144 def __getitem__(self, idx):
145 return self.data[idx]
146
147
148def worker_init_fn(_):

Callers 1

setupMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected