def forward_context(self) -> Generator[None, None, None]:
        """A context manager to change the default tensor type when tensors get created during the module's forward.

        See: :meth:`torch.set_default_tensor_type`

        """
        default_dtype = torch.get_default_dtype()
        torch.set_default_dtype(self._desired_input_dtype)
        try:
            yield
        finally:
            torch.set_default_dtype(default_dtype)
A context manager to change the default tensor type when tensors get created during the module's forward.

        See: :meth:`torch.set_default_tensor_type`

        
src/lightning/pytorch/plugins/precision/half.py