code: def decode_transformer(
      encoder_output,
      encoder_decoder_attention_bias,
      targets,
      hparams,
      name,
  ):
      """Original Transformer decoder."""
      with tf.variable_scope(name):
          targets = common_layers.flatten4d3d(targets)
  
          (
              decoder_input,
              decoder_self_bias,
          ) = transformer.transformer_prepare_decoder(targets, hparams)
  
          decoder_input = tf.nn.dropout(
              decoder_input, 1.0 - hparams.layer_prepostprocess_dropout
          )
  
          decoder_output = transformer.transformer_decoder(
              decoder_input,
              encoder_output,
              decoder_self_bias,
              encoder_decoder_attention_bias,
              hparams,
          )
          decoder_output = tf.expand_dims(decoder_output, axis=2)
          decoder_output_shape = common_layers.shape_list(
              decoder_output
          )
          decoder_output = tf.reshape(
              decoder_output,
              [decoder_output_shape[0], -1, 1, hparams.hidden_size],
          )
          # Expand since t2t expects 4d tensors.
          return decoder_output
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  from six.moves import range
  from tensor2tensor.layers import common_layers
  from tensor2tensor.models import transformer
  from tensor2tensor.utils import beam_search
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  from tensorflow.python.training import moving_averages
label_desc: Use image node_id 9 for calling a global function with example usage: decode_transformer(encoder_output, encoder_decoder_attention_bias, targets, hparams, name) and returns: decoder_output