def get_pairwise_addition(x, mask=None):
    """
    Args:
        x:    (B, N_max, F)
        mask: (B, N_max, N_max)
    Returns:
        sun:  (B, N_max, N_max, F)
    """
    B, N_max, F = x.size()
    x_rep_j = x.unsqueeze(1).expand(B, N_max, N_max, F)
    x_rep_i = x.unsqueeze(2).expand(B, N_max, N_max, F)
    return x_rep_j + x_rep_i