def to(self, *args: Any, **kwargs: Any) -> Self:
        """See :meth:`torch.nn.Module.to`."""
        # this converts `str` device to `torch.device`
        device, dtype = torch._C._nn._parse_to(*args, **kwargs)[:2]
        _update_properties(self, device=device, dtype=dtype)
        return super().to(*args, **kwargs)
See :meth:`torch.nn.Module.to`.
src/lightning/fabric/utilities/device_dtype_mixin.py