def batch_p_dist(x, y, p=2):
    """
    calculate pairwise p_dist, the first index of x and y are batch
    return [x.shape[0], y.shape[0]]
    """
    x = x.unsqueeze(1)
    diff = x - y
    return paddle.norm(diff, p=p, axis=list(range(2, diff.dim())))

    calculate pairwise p_dist, the first index of x and y are batch
    return [x.shape[0], y.shape[0]]
    
ppdet/modeling/assigners/uniform_assigner.py