def get_rank()

in train.py [0:0]


def get_rank():
    return dist.get_rank() if is_dist() else 0