import tensorflow as tf

        self.Z = tf.placeholder(tf.float32, (None, None, fourier_window_size // 2 + 1))

        batch_size = tf.shape(self.X)[0]
        seq_lens = tf.count_nonzero(tf.reduce_sum(self.decoder_inputs, -1), 1, dtype=tf.int32) + 1

        def cells(reuse=False):
            return tf.contrib.rnn.DropoutWrapper(
                tf.nn.rnn_cell.LSTMCell(
                    size_layers, initializer=tf.orthogonal_initializer(), reuse=reuse
                ),
                state_keep_prob=dropout,
                output_keep_prob=dropout,
            )

        def attention(encoder_out, seq_len, reuse=False):
            attention_mechanism = tf.contrib.seq2seq.LuongAttention(
                num_units=size_layers, memory=encoder_out, memory_sequence_length=seq_len
            )
            return tf.contrib.seq2seq.AttentionWrapper(
                cell=tf.nn.rnn_cell.MultiRNNCell([cells(reuse) for _ in range(num_layers)]),
                attention_mechanism=attention_mechanism,
                attention_layer_size=size_layers,
                alignment_history=True,
            )

        encoder_cells = tf.nn.rnn_cell.MultiRNNCell([cells() for _ in range(num_layers)])
        encoder_out, encoder_state = tf.nn.dynamic_rnn(
            cell=encoder_cells, inputs=forward, sequence_length=seq_lens, dtype=tf.float32
        )

