code: def transformer_latent_decoder(
      x, encoder_output, ed_attention_bias, hparams, name=None
  ):
      """Transformer decoder over latents using latent_attention_type.
  
      Args:
        x: Tensor of shape [batch, length_q, hparams.hidden_size]. length_q is the
          latent length, which is
          height * width * hparams.num_latents / (2**hparams.num_compress_steps).
        encoder_output: Tensor of shape [batch, length_kv, hparams.hidden_size].
        ed_attention_bias: Tensor which broadcasts with shape [batch,
          hparams.num_heads, length_q, length_kv]. Encoder-decoder attention bias.
        hparams: HParams.
        name: string, variable scope.
  
      Returns:
        Tensor of shape [batch, length_q, hparams.hidden_size].
      """
      with tf.variable_scope(
          name, default_name="transformer_latent_dec"
      ):
          batch_size = common_layers.shape_list(x)[0]
          compressed_img_len = hparams.img_len // 2 ** (
              hparams.num_compress_steps // 2
          )
          x = tf.reshape(
              x,
              [
                  batch_size,
                  compressed_img_len,
                  compressed_img_len * hparams.num_latents,
                  hparams.hidden_size,
              ],
          )
          decoder_input, _, _ = cia.prepare_decoder(x, hparams)
          decoder_output = cia.transformer_decoder_layers(
              decoder_input,
              encoder_output,
              hparams.num_latent_layers or hparams.num_hidden_layers,
              hparams,
              attention_type=hparams.latent_attention_type,
              encoder_decoder_attention_bias=ed_attention_bias,
              name="decoder",
          )
          decoder_output = tf.reshape(
              decoder_output,
              [
                  batch_size,
                  compressed_img_len**2 * hparams.num_latents,
                  hparams.hidden_size,
              ],
          )
          return decoder_output
  
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 15 for calling a global function with example usage: transformer_latent_decoder(x, encoder_output, ed_attention_bias, hparams, name) and returns: decoder_output