import tensorflow as tf

        random.seed(111)
        np.random.seed(111)

        enc_inp = [tf.constant(i + 1, tf.int32, shape=[batch_size])
                   for i in range(num_enc_timesteps)]
        dec_inp_fp_true = [tf.constant(i, tf.int32, shape=[batch_size])
                           for i in range(num_dec_timesteps)]
        dec_inp_holder_fp_false = [tf.placeholder(tf.int32, shape=[batch_size])
                                   for _ in range(num_dec_timesteps)]
        targets = [tf.constant(i + 1, tf.int32, shape=[batch_size])
                   for i in range(num_dec_timesteps)]
        weights = [tf.constant(1.0, shape=[batch_size])
                   for i in range(num_dec_timesteps)]

        def ForwardBackward(enc_inp, dec_inp, feed_previous):
          scope_name = "fp_{}".format(feed_previous)
          with tf.variable_scope(scope_name):
            dec_op, _ = seq2seq(enc_inp, dec_inp, feed_previous=feed_previous)
            net_variables = tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES,
                                              scope_name)
          optimizer = tf.train.AdamOptimizer(0.03, epsilon=1e-5)
          update_op = optimizer.minimize(
