class_docstr: Transformer based encoder layer
docstr: Model forward pass.
  
  Args:
      x (tf.Tensor): Input tensor.
      training (tf.Tensor): Training tensor.
      mask (tf.Tensor): Mask tensor.
  
  Returns:
      tf.Tensor: Output tensor.
docstr_tok: ["Model","forward","pass",".","Args",":","x","(","tf.Tensor",")",":","Input","tensor",".","training","(","tf.Tensor",")",":","Training","tensor",".","mask","(","tf.Tensor",")",":","Mask","tensor",".","Returns",":","tf.Tensor",":","Output","tensor","."]
code: def call_(self, x, training, mask):
      """Model forward pass.
  
      Args:
          x (tf.Tensor): Input tensor.
          training (tf.Tensor): Training tensor.
          mask (tf.Tensor): Mask tensor.
  
      Returns:
          tf.Tensor: Output tensor.
      """
  
      attn_output = self.mha(
          queries=self.layer_normalization(x), keys=x
      )
      attn_output = self.dropout1(attn_output, training=training)
      out1 = self.layernorm1(x + attn_output)
  
      # feed forward network
      ffn_output = self.ffn(
          out1
      )  # (batch_size, input_seq_len, d_model)
      ffn_output = self.dropout2(ffn_output, training=training)
      out2 = self.layernorm2(
          out1 + ffn_output
      )  # (batch_size, input_seq_len, d_model)
  
      # masking
      out2 *= mask
  
      return out2
  
imports: import random
  import numpy
  from tqdm import tqdm
  import tensorflow
  from recommenders.utils.timer import Timer
label_desc: Use image node_id 2 for calling the EncoderLayer obj's underlying member method code with example usage: obj.call_(x, training, mask) and returns: out2