docstr: A transformer encoder block consists of a self-attention and a feed-
  forward layer with pre/post process blocks in between.
code: def hybrid_forward(self, F, data: Tensor) -> Tensor:
      """
      A transformer encoder block consists of a self-attention and a feed-
      forward layer with pre/post process blocks in between.
      """
  
      # input layer
      inputs = self.enc_input_layer(data)
  
      # self-attention
      data_self_att, _ = self.enc_self_att(
          self.enc_pre_self_att(inputs, None)
      )
      data = self.enc_post_self_att(data_self_att, inputs)
  
      # feed-forward
      data_ff = self.enc_ff(data)
      data = self.enc_post_ff(data_ff, data)
  
      return data
  
file_path: gluonts/src/gluonts/mx/model/transformer/trans_encoder.py
imports: from typing import Dict
  from mxnet.gluon import HybridBlock
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from .layers import InputLayer, MultiHeadSelfAttention, TransformerFeedForward, TransformerProcessBlock
label_desc: Use image node_id 2 for calling the TransformerEncoder obj's underlying member method code with example usage: obj.hybrid_forward(F, data) and returns: data