import tensorflow as tf


    # Need to prepare a mask to zero out the padding symbols.

    # Make a batch_size x max_sequence_len matrix where each
    # row contains the length repeated max_sequence_len times.
    lengths_transposed = tf.expand_dims(tf.to_int32(self.seq_lens), 1)
    lengths_tiled = tf.tile(lengths_transposed, [1, max_sequence_len])

    # Make a matrix where each row contains [0, 1, ..., max_sequence_len]
    r = tf.range(0, max_sequence_len, 1)
    range_row = tf.expand_dims(r, 0)
    range_tiled = tf.tile(range_row, [batch_size, 1])
