import tensorflow as tf

            if is_training and config.keep_prob < 1:
                inputs = tf.nn.dropout(inputs, config.keep_prob)

            output, state = self._build_rnn_graph(inputs, config, is_training)

            softmax_w = tf.get_variable(
                'softmax_w', [hidden_size, vocab_size], dtype=tf.float32)
            softmax_b = tf.get_variable('softmax_b', [vocab_size], dtype=tf.float32)
            logits = tf.nn.xw_plus_b(output, softmax_w, softmax_b)
            logits = tf.reshape(logits, [self.batch_size, self.num_steps, vocab_size])

            loss = tf.contrib.seq2seq.sequence_loss(
                logits,
                input_.targets,
                tf.ones([self.batch_size, self.num_steps], dtype=tf.float32),
                average_across_timesteps=False,
