def freeze(self) -> None:
        r"""Freeze all params for inference.

        Example::

            model = MyLightningModule(...)
            model.freeze()

        """
        for param in self.parameters():
            param.requires_grad = False

        self.eval()
Freeze all params for inference.

        Example::

            model = MyLightningModule(...)
            model.freeze()

        
src/lightning/pytorch/core/module.py