import tensorflow as tf

    self.seq_lens = tf.placeholder(tf.int64, [batch_size], name='seq_lens')
    self.example_weights = tf.placeholder(tf.float32, [batch_size],
                                          name='example_weights')

    embeddings = c2v.GetEmbeddings(self.x)
    self._inputs = [tf.squeeze(input_, [1]) for input_ in
                    tf.split(1, max_sequence_len, embeddings)]

    # 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])

    self.lengths_transposed = lengths_transposed
    self.lengths_tiled = lengths_tiled
    self.range_row = range_row
    self.range_tiled = range_tiled
