def broadcast_object(self, obj: BroadcastT, src=0) -> BroadcastT:
        """
        Broadcasts the given object from a source process to all processes.

        Note: if broadcasting a Tensor, consider using :meth:`broadcast`
        instead.

        Differences with torch.distributed:
            - No-op if not running a distributed training.

        :param obj: The object to be broadcasted.
        :param src: The rank of the source process. Defaults to 0,
            which is the main process.
        :return: The object obtained from the source process.
        """

        if not self.is_distributed:
            return obj

        io_list = [obj]

        broadcast_object_list(io_list, src=src)
        return io_list[0]

        Broadcasts the given object from a source process to all processes.

        Note: if broadcasting a Tensor, consider using :meth:`broadcast`
        instead.

        Differences with torch.distributed:
            - No-op if not running a distributed training.

        :param obj: The object to be broadcasted.
        :param src: The rank of the source process. Defaults to 0,
            which is the main process.
        :return: The object obtained from the source process.
        
avalanche/distributed/distributed_helper.py