in torchrecipes/utils/distributed_utils.py [0:0]
def get_rank() -> int: if torch.distributed.is_available() and torch.distributed.is_initialized(): return torch.distributed.get_rank() return 0