class_docstr: Attention baseline model for VQA.
docstr: Predict.
docstr_tok: ["Predict","."]
code: def infer(
      self,
      features=None,
      decode_length=1,
      beam_size=1,
      top_beams=1,
      alpha=0.0,
      use_tpu=False,
  ):
      """Predict."""
      del decode_length, beam_size, top_beams, alpha, use_tpu
      assert features is not None
      logits, _ = self(features)
      assert len(logits.get_shape()) == 5
      logits = tf.squeeze(logits, [1, 2, 3])
      log_probs = common_layers.log_prob_from_logits(logits)
      predictions, scores = common_layers.argmax_with_score(log_probs)
      return {
          "outputs": predictions,
          "scores": scores,
      }
  
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 2 for calling the VqaAttentionBaseline obj's underlying member method code with example usage: obj.infer(features, decode_length, beam_size, top_beams, alpha, use_tpu) and returns: dict