class_docstr: TransformerEncoderLayer is based on "Attention
  is all you Need" (https://arxiv.org/pdf/1706.03762.pdf).
class_docstr_tok: ["TransformerEncoderLayer","is","based","on","``","Attention","is","all","you","Need","''","(","https",":","\/\/arxiv.org\/pdf\/1706.03762.pdf",")","."]
docstr: Input shape: [batch_size, seq_enc_len, hidden_dim]
  Mask shape: [batch_size, seq_enc_len]
docstr_tok: ["Input","shape",":","[","batch_size",",","seq_enc_len",",","hidden_dim","]","Mask","shape",":","[","batch_size",",","seq_enc_len","]"]
code: def call(self, inps, training=None, mask=None):
      """
      Input shape: [batch_size, seq_enc_len, hidden_dim]
      Mask shape: [batch_size, seq_enc_len]
      """
      # Multi Head Attention
      inps = self.embed_dense(inps)
      self_attn_outs, _ = self.self_attn_layer(
          (inps, inps, inps), training=training, mask=mask
      )
      self_attn_outs = self.self_attn_dropout(
          self_attn_outs, training=training
      )
      self_attn_outs += inps
      self_attn_outs = self.self_attn_norm(self_attn_outs)
      # Position Wise Feed Forward
      feed_forward_outs = self.feed_forward_layer(self_attn_outs)
      feed_forward_outs = self.feed_forward_dropout(
          feed_forward_outs, training=training
      )
      feed_forward_outs += self_attn_outs
      outs = self.feed_forward_norm(feed_forward_outs)
      return outs
  
imports: import math
  from absl import logging
  import numpy
  import delta.compat
  from tensorflow.python.util import nest
  from delta.layers.base_layer import Layer
  from delta.layers import utils_tf
  import delta.layers
label_desc: Use image node_id 2 for calling the TransformerEncoderLayer obj's underlying member method code with example usage: obj.call(inps, training, mask) and returns: outs