def get_attn_pad_mask(key):
    """
    # pad mask is to shield the padding position, which is used to fill all the samples to the same length.
    :param key: [batch_size, len_k], information before embedding
    :return: pad_mask: (batch_size, 1, len_k) : means all the queries positions are the same, while every sample is different
    """
    # position equal to 0 is padding token, of which True is to be masked
    pad_mask = key.detach().eq(0).unsqueeze(1)
    return pad_mask