import tensorflow as tf

          dec, mem = tf.nn.seq2seq.embedding_rnn_seq2seq(
              enc_inp, dec_inp, cell1, num_encoder_symbols=2,
              num_decoder_symbols=5, embedding_size=2)
          sess.run([tf.global_variables_initializer()])
          res = sess.run(dec)
          self.assertEqual(3, len(res))
          self.assertEqual((2, 5), res[0].shape)

          res = sess.run([mem])
          self.assertEqual((2, 4), res[0].shape)

        # Test externally provided output projection.
        w = tf.get_variable("proj_w", [2, 5])
        b = tf.get_variable("proj_b", [5])
        with tf.variable_scope("proj_seq2seq"):
          dec, _ = tf.nn.seq2seq.embedding_rnn_seq2seq(
              enc_inp, dec_inp, cell, num_encoder_symbols=2,
              num_decoder_symbols=5, embedding_size=2, output_projection=(w, b))
        sess.run([tf.global_variables_initializer()])
        res = sess.run(dec)
        self.assertEqual(3, len(res))
        self.assertEqual((2, 2), res[0].shape)

        # Test that previous-feeding model ignores inputs after the first.
        dec_inp2 = [tf.constant(0, tf.int32, shape=[2]) for _ in range(3)]
        with tf.variable_scope("other"):
          d3, _ = tf.nn.seq2seq.embedding_rnn_seq2seq(
              enc_inp, dec_inp2, cell, num_encoder_symbols=2,
