import torch


def create_span_mask(start, end, context_size):
    """ creates tensor for masking a token span  """
    mask = torch.zeros(context_size, dtype=torch.bool)
    mask[start:end] = 1
    return mask