MCPcopy Create free account
hub / github.com/Text-to-Audio/Make-An-Audio / __init__

Method __init__

main.py:181–201  ·  view source on GitHub ↗
(self, batch_size, train=None, validation=None, test=None, predict=None,
                 wrap=False, num_workers=None, shuffle_test_loader=False, use_worker_init_fn=False,
                 shuffle_val_dataloader=False)

Source from the content-addressed store, hash-verified

179
180class DataModuleFromConfig(pl.LightningDataModule):# batchloader outputshape should be (b,h,w,c) and it will be permuted to (b,c,h,w) in autoencoder.get_input()
181 def __init__(self, batch_size, train=None, validation=None, test=None, predict=None,
182 wrap=False, num_workers=None, shuffle_test_loader=False, use_worker_init_fn=False,
183 shuffle_val_dataloader=False):
184 super().__init__()
185 self.batch_size = batch_size
186 self.dataset_configs = dict()
187 self.num_workers = num_workers if num_workers is not None else batch_size * 2
188 self.use_worker_init_fn = use_worker_init_fn
189 if train is not None:
190 self.dataset_configs["train"] = train
191 self.train_dataloader = self._train_dataloader
192 if validation is not None:
193 self.dataset_configs["validation"] = validation
194 self.val_dataloader = partial(self._val_dataloader, shuffle=shuffle_val_dataloader)
195 if test is not None:
196 self.dataset_configs["test"] = test
197 self.test_dataloader = partial(self._test_dataloader, shuffle=shuffle_test_loader)
198 if predict is not None:
199 self.dataset_configs["predict"] = predict
200 self.predict_dataloader = self._predict_dataloader
201 self.wrap = wrap
202
203 def prepare_data(self):
204 for data_cfg in self.dataset_configs.values():

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected