def sharded_model(self) -> AbstractContextManager:
        r"""Instantiate a model under this context manager to prepare it for model-parallel sharding.

        .. deprecated:: This context manager is deprecated in favor of :meth:`init_module`, use it instead.

        """
        rank_zero_deprecation("`Fabric.sharded_model()` is deprecated in favor of `Fabric.init_module()`.")
        self._validate_launched()
        if isinstance(self.strategy, _Sharded):
            return self.strategy.module_sharded_context()
        return nullcontext()
Instantiate a model under this context manager to prepare it for model-parallel sharding.

        .. deprecated:: This context manager is deprecated in favor of :meth:`init_module`, use it instead.

        
src/lightning/fabric/fabric.py