code: def transformer_text_encoder(
      inputs, target_space, hparams, name=None
  ):
      """Transformer text encoder over inputs with unmasked full attention.
  
      Args:
        inputs: Tensor of shape [batch, length, 1, hparams.hidden_size].
        target_space: int. Used for encoding inputs under a target space id.
        hparams: HParams.
        name: string, variable scope.
  
      Returns:
        encoder_output: Tensor of shape [batch, length, hparams.hidden_size].
        ed: Tensor of shape [batch, 1, 1, length]. Encoder-decoder attention bias
          for any padded tokens.
      """
      with tf.variable_scope(
          name, default_name="transformer_text_encoder"
      ):
          inputs = common_layers.flatten4d3d(inputs)
          [
              encoder_input,
              encoder_self_attention_bias,
              ed,
          ] = transformer_layers.transformer_prepare_encoder(
              inputs, target_space=target_space, hparams=hparams
          )
          encoder_input = tf.nn.dropout(
              encoder_input, 1.0 - hparams.dropout
          )
          encoder_output = transformer_layers.transformer_encoder(
              encoder_input, encoder_self_attention_bias, hparams
          )
          return encoder_output, ed
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from six.moves import range
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_image_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import transformer_layers
  from tensor2tensor.utils import beam_search
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  import tensorflow_probability
label_desc: Use image node_id 13 for calling a global function with example usage: transformer_text_encoder(inputs, target_space, hparams, name) and returns: encoder_output,  ed