def update_main_process_results(self, trainer: "pl.Trainer", extra: dict[str, Any]) -> None:
        """Retrieve the :attr:`trainer.callback_metrics` dictionary from the given queue. To preserve consistency, we
        convert bytes back to ``torch.Tensor``.

        Args:
            trainer: reference to the Trainer.
            extra: A dictionary with trainer state that was sent from the worker process and needs to be restored
                on the current trainer.

        """
        # NOTE: `get_extra_results` needs to be called before
        callback_metrics_bytes = extra["callback_metrics_bytes"]
        callback_metrics = torch.load(io.BytesIO(callback_metrics_bytes), weights_only=True)
        trainer.callback_metrics.update(callback_metrics)
Retrieve the :attr:`trainer.callback_metrics` dictionary from the given queue. To preserve consistency, we
        convert bytes back to ``torch.Tensor``.

        Args:
            trainer: reference to the Trainer.
            extra: A dictionary with trainer state that was sent from the worker process and needs to be restored
                on the current trainer.

        
src/lightning/pytorch/strategies/launchers/multiprocessing.py