def hybrid_forward(self, F, inputs, mask=None):  <EOL>
outputs, attention_weights =self.attention_cell(inputs, inputs, inputs, mask)<EOL>outputs = self.proj(outputs)<EOL>if self._dropout:<EOL><INDENT>outputs = self.dropout_layer(outputs)<EOL><DEDENT>if self._use_residual:<EOL><INDENT>outputs = outputs + inputs<EOL><DEDENT>outputs = self.layer_norm(outputs)<EOL>outputs = self.ffn(outputs)<EOL>additional_outputs = []<EOL>if self._output_attention:<EOL><INDENT>additional_outputs.append(attention_weights)<EOL><DEDENT>return outputs, additional_outputs<EOL>
Transformer Encoder Attention Cell.

        Parameters
        ----------
        inputs : Symbol or NDArray
            Input sequence. Shape (batch_size, length, C_in)
        mask : Symbol or NDArray or None
            Mask for inputs. Shape (batch_size, length, length)

        Returns
        -------
        encoder_cell_outputs: list
            Outputs of the encoder cell. Contains:

            - outputs of the transformer encoder cell. Shape (batch_size, length, C_out)
            - additional_outputs of all the transformer encoder cell