class_docstr: Attention baseline model for VQA.
code: def body(self, features):
      hp = self.hparams
      # pylint: disable=eval-used
      if hp.image_input_type == "image":
          image_feat = vqa_layers.image_embedding(
              features["inputs"],
              model_fn=eval(hp.image_model_fn),
              trainable=hp.train_resnet,
              is_training=hp.mode == tf_estimator.ModeKeys.TRAIN,
          )
      else:
          image_feat = features["inputs"]
  
      image_feat = common_layers.flatten4d3d(image_feat)
      # image feature self attention
      # image_feat = tf.nn.dropout(
      #     image_feat, keep_prob=1.-hp.layer_prepostprocess_dropout)
  
      # image_feat = image_feat - tf.reduce_mean(
      #     image_feat, axis=-1, keepdims=True)
      # image_feat = tf.nn.l2_normalize(image_feat, -1)
      # utils.collect_named_outputs("norms", "image_feat_after_l2",
      #                             tf.norm(image_feat, axis=-1))
  
      image_feat = tf.nn.dropout(image_feat, keep_prob=1.0 - hp.dropout)
  
      image_feat = image_encoder(image_feat, hp)
      utils.collect_named_outputs(
          "norms", "image_feat_encoded", tf.norm(image_feat, axis=-1)
      )
      image_feat = common_layers.l2_norm(image_feat)
      utils.collect_named_outputs(
          "norms", "image_feat_encoded_l2", tf.norm(image_feat, axis=-1)
      )
  
      query = question_encoder(features["question"], hp)
      utils.collect_named_outputs(
          "norms", "query", tf.norm(query, axis=-1)
      )
  
      image_ave = attn(image_feat, query, hp)
      utils.collect_named_outputs(
          "norms", "image_ave", tf.norm(image_ave, axis=-1)
      )
  
      image_question = tf.concat([image_ave, query], axis=1)
      utils.collect_named_outputs(
          "norms", "image_question", tf.norm(image_question, axis=-1)
      )
  
      image_question = tf.nn.dropout(image_question, 1.0 - hp.dropout)
  
      output = mlp(image_question, hp)
      utils.collect_named_outputs(
          "norms", "output", tf.norm(output, axis=-1)
      )
  
      norm_tensors = utils.convert_collection_to_dict("norms")
      vqa_layers.summarize_tensors(norm_tensors, tag="norms/")
  
      # Expand dimension 1 and 2
      return tf.expand_dims(tf.expand_dims(output, axis=1), axis=2)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import vqa_layers
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  from tensorflow.contrib import rnn
  from tensorflow.contrib.layers.python.layers import utils
  from tensorflow.contrib.slim.python.slim.nets.resnet_v1 import resnet_v1_152
  from tensorflow.contrib.slim.python.slim.nets.resnet_v2 import resnet_v2_152
label_desc: Use image node_id 1 for calling the VqaSimpleImageSelfAttention obj's underlying member method code with example usage: obj.body(features) and returns: tf