code: def _forward_mmt_and_output(self, sample_list, fwd_results):
      if self.training:
          fwd_results["prev_inds"] = sample_list.train_prev_inds.clone()
          self._forward_mmt(sample_list, fwd_results)
          self._forward_output(sample_list, fwd_results)
      else:
          dec_step_num = sample_list.train_prev_inds.size(1)
          # fill prev_inds with BOS_IDX at index 0, and zeros elsewhere
          fwd_results["prev_inds"] = torch.zeros_like(
              sample_list.train_prev_inds
          )
          fwd_results["prev_inds"][:, 0] = self.answer_processor.BOS_IDX
  
          # greedy decoding at test time
          for _ in range(dec_step_num):
              self._forward_mmt(sample_list, fwd_results)
              self._forward_output(sample_list, fwd_results)
  
              # find the highest scoring output (either a fixed vocab
              # or an OCR), and add it to prev_inds for auto-regressive
              # decoding
              argmax_inds = fwd_results["scores"].argmax(dim=-1)
              fwd_results["prev_inds"][:, 1:] = argmax_inds[:, :-1]
  
imports: import functools
  import logging
  import math
  import torch
  import torch.nn.functional
  from mmf.common.registry import registry
  from mmf.models.base_model import BaseModel
  from mmf.modules.layers import ClassifierLayer
  from mmf.utils.build import build_image_encoder
  from omegaconf import OmegaConf
  from torch import nn
label_desc: Use image node_id 16 for calling the M4C obj's underlying member method code with example usage: obj._forward_mmt_and_output(sample_list, fwd_results) without return types