class_docstr: Image-to-image transformer predicting blocks of the output in parallel.
class_docstr_tok: ["Image-to-image","transformer","predicting","blocks","of","the","output","in","parallel","."]
code: def body(self, features):
      assert self._hparams.block_size > 0
      assert not common_layers.is_xla_compiled()
  
      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",
      )
  
      assert not isinstance(decoder_output, tuple)
      assert len(decoder_output.shape) == 4
  
      relu_dropout_broadcast_dims = (
          common_layers.comma_separated_string_to_integer_list(
              getattr(self._hparams, "relu_dropout_broadcast_dims", "")
          )
      )
  
      with tf.variable_scope(
          "block_size_%d" % self._hparams.block_size
      ):
          tf.logging.info(
              "Using block_size %d", self._hparams.block_size
          )
          block_output = common_layers.dense_relu_dense(
              decoder_output,
              self._hparams.block_size * self._hparams.filter_size,
              self._hparams.block_size * self._hparams.hidden_size,
              dropout=self._hparams.relu_dropout,
              dropout_broadcast_dims=relu_dropout_broadcast_dims,
          )
  
      batch_size, rows, cols = common_layers.shape_list(decoder_output)[
          :3
      ]
      decoder_output = tf.reshape(
          decoder_output,
          [batch_size, rows, cols, 1, self._hparams.hidden_size],
      )
      block_output = tf.reshape(
          block_output,
          [
              batch_size,
              rows,
              cols,
              self._hparams.block_size,
              self._hparams.hidden_size,
          ],
      )
  
      block_output = common_layers.layer_postprocess(
          decoder_output, block_output, self._hparams
      )
  
      return block_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 Img2imgTransformerBlockParallel obj's underlying member method code with example usage: obj.body(features) and returns: block_output