def rank(self) -> int:
        """
        The current tank.

        :return: The rank of the current process.
            Returns 0 if not running a distributed training.
        """
        if torch.distributed.is_initialized():
            return torch.distributed.get_rank()
        return 0

        The current tank.

        :return: The rank of the current process.
            Returns 0 if not running a distributed training.
        
avalanche/distributed/distributed_helper.py