code: def decode_transformer(encoder_output, encoder_decoder_attention_bias, targets,
                         hparams, name):
    
    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
docs: Original Transformer decoder.