def world_size(self) -> int:
        """
        The world size.

        :return: The world size of the default group.
            Returns 1 if not running a distributed training.
        """

        if torch.distributed.is_initialized():
            return torch.distributed.get_world_size()
        return 1

        The world size.

        :return: The world size of the default group.
            Returns 1 if not running a distributed training.
        
avalanche/distributed/distributed_helper.py