class_docstr: Image 2 Image transformer net.
class_docstr_tok: ["Image","2","Image","transformer","net","."]
code: def body(self, features):
      hparams = copy.copy(self._hparams)
      targets = features["targets"]
      inputs = features["inputs"]
      if not (
          tf.get_variable_scope().reuse
          or hparams.mode == tf_estimator.ModeKeys.PREDICT
      ):
          tf.summary.image("inputs", inputs, max_outputs=1)
          tf.summary.image("targets", targets, max_outputs=1)
  
      encoder_input = cia.prepare_encoder(inputs, hparams)
      encoder_output = cia.transformer_encoder_layers(
          encoder_input,
          hparams.num_encoder_layers,
          hparams,
          attention_type=hparams.enc_attention_type,
          name="encoder",
      )
      decoder_input, rows, cols = cia.prepare_decoder(targets, hparams)
      decoder_output = cia.transformer_decoder_layers(
          decoder_input,
          encoder_output,
          hparams.num_decoder_layers,
          hparams,
          attention_type=hparams.dec_attention_type,
          name="decoder",
      )
      output = cia.create_output(
          decoder_output, rows, cols, targets, hparams
      )
      return output
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import numpy
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_image_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 1 for calling the Img2imgTransformer obj's underlying member method code with example usage: obj.body(features) and returns: output