code: def transformer_encoder_layers(
      inputs,
      num_layers,
      hparams,
      attention_type=AttentionType.GLOBAL,
      self_attention_bias=None,
      q_padding="VALID",
      kv_padding="VALID",
      name="transformer",
  ):
      """Multi layer transformer encoder."""
      x = inputs
      x = tf.nn.dropout(x, 1.0 - hparams.layer_prepostprocess_dropout)
  
      for layer in range(num_layers):
          # attention layers + skip connections
          with tf.variable_scope("%s_layer_%d" % (name, layer)):
              if attention_type == AttentionType.LOCAL_2D:
                  y = local_attention_2d(
                      common_layers.layer_preprocess(x, hparams),
                      hparams,
                      attention_type="local_attention_2d",
                  )
              elif attention_type == AttentionType.LOCAL_1D:
                  y = local_attention_1d(
                      common_layers.layer_preprocess(x, hparams),
                      hparams,
                      attention_type="local_unmasked",
                      q_padding=q_padding,
                      kv_padding=kv_padding,
                  )
              elif attention_type == AttentionType.GLOBAL:
                  y = full_self_attention(
                      common_layers.layer_preprocess(x, hparams),
                      self_attention_bias,
                      hparams,
                      q_padding=q_padding,
                      kv_padding=kv_padding,
                  )
              x = common_layers.layer_postprocess(x, y, hparams)
              # feed-fwd layer + skip connections
              y = ffn_layer(
                  common_layers.layer_preprocess(x, hparams), hparams
              )
              x = common_layers.layer_postprocess(x, y, hparams)
      return common_layers.layer_preprocess(x, hparams)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from six.moves import range
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import expert_utils
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 11 for calling a global function with example usage: transformer_encoder_layers(inputs, num_layers, hparams, attention_type, _attention_bias, q_padding, kv_padding, name) and returns: common_layers