PyTorch Lightning - LightningModule for ModuleList / ModuleDict?

Viewed 435

PyTorch has ModuleList and ModuleDict. How do I create equivalents in PyTorch Lightning to get all the nice properties of LightningModules?

1 Answers

You can instantiate the ModuleDict/ModuleList in the LightningModule and since the both ModuleDict and ModuleList inherits from torch.nn.Module so it will work just like that without you needing to do anything.

Related