Ejemplo n.º 1
0
 def lightning_module(self) -> Optional["pl.LightningModule"]:
     if not _FAIRSCALE_AVAILABLE:  # pragma: no cover
         raise MisconfigurationException(
             "`DDPShardedStrategy` requires `fairscale` to be installed."
             " Install it by running `pip install fairscale`."
         )
     return unwrap_lightning_module_sharded(self.model) if self.model is not None else None
Ejemplo n.º 2
0
 def lightning_module(self) -> 'pl.LightningModule':
     if not _FAIRSCALE_AVAILABLE:  # pragma: no cover
         raise MisconfigurationException(
             "`DDPShardedPlugin` requires `fairscale` to be installed."
             " Install it by running `pip install fairscale`."
         )
     return unwrap_lightning_module_sharded(self._model)
Ejemplo n.º 3
0
 def lightning_module(self) -> LightningModule:
     return unwrap_lightning_module_sharded(self._model)