code: def transformer_image_decoder(
      targets, encoder_output, ed_attention_bias, hparams, name=None
  ):
      """Transformer image decoder over targets with local attention.
  
      Args:
        targets: Tensor of shape [batch, ...], and whose size is batch * height *
          width * hparams.num_channels * hparams.hidden_size.
        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, height, width * hparams.num_channels,
        hparams.hidden_size].
      """
      with tf.variable_scope(name, default_name="transformer_dec"):
          batch_size = common_layers.shape_list(targets)[0]
          targets = tf.reshape(
              targets,
              [
                  batch_size,
                  hparams.img_len,
                  hparams.img_len,
                  hparams.num_channels * hparams.hidden_size,
              ],
          )
          decoder_input, _, _ = cia.prepare_decoder(targets, hparams)
          decoder_output = cia.transformer_decoder_layers(
              decoder_input,
              encoder_output,
              hparams.num_decoder_layers or hparams.num_hidden_layers,
              hparams,
              attention_type=hparams.dec_attention_type,
              encoder_decoder_attention_bias=ed_attention_bias,
              name="decoder",
          )
          decoder_output = tf.reshape(
              decoder_output,
              [
                  batch_size,
                  hparams.img_len,
                  hparams.img_len * hparams.num_channels,
                  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 14 for calling a global function with example usage: transformer_image_decoder(targets, encoder_output, ed_attention_bias, hparams, name) and returns: decoder_output