import tensorflow as tf

    :param before_padding: [batch_size] tensor of before_padding values.
    :param window_size: scalar window size.
    :return: [batch_size, window_size] boolean tensor mask.
    """
    return tf.logical_not(tf.sequence_mask(before_padding, maxlen=window_size))


def _right_mask(after_padding, window_size):
