import torch


def get_mention_token_dist_tensors(m1, m2):
    """ Returns distance in tokens between two mentions """
    succ = m1[0] < m2[0]
    first = m1 if succ else m2
    second = m2 if succ else m1

    d = second[0] - (first[1] - 1)
    if d < 0:
        return torch.tensor(0, dtype=torch.long, device=m1.device)
    return d