code: def forward(self, sample_list):
      scores = torch.rand(sample_list.get_batch_size(), 3127)
      decoder = registry.get_decoder_class(self.config.inference.type)(
          self.vocab, self.config
      )
      sample_list.add_field("targets", sample_list.answers[:, 0, 1:])
      sample_list = decoder.init_batch(sample_list)
      batch_size = sample_list.image_feature_0.size(0)
      data = {}
      data["texts"] = sample_list.answers.new_full(
          (batch_size, 1), self.vocab.SOS_INDEX, dtype=torch.long
      )
      timesteps = 10
      output = None
      batch_size_t = batch_size
      for t in range(timesteps):
          data, batch_size_t = self.get_data_t(data, batch_size_t)
          output = torch.randn(batch_size_t, self.vocab.get_size())
          if t == timesteps - 1:
              # manually add EOS to the first example.
              output = (
                  torch.ones(batch_size_t, self.vocab.get_size())
                  * -30.0
              )
              output[0, self.vocab.EOS_INDEX] = 10
          finish, data, batch_size_t = decoder.decode(t, data, output)
          if finish:
              break
  
      model_output = {"scores": scores}
      model_output["captions"] = decoder.get_result()
  
      return model_output
  
file_path: mmf/tests/utils/test_model.py
imports: import torch
  from mmf.common.registry import registry
  from torch import nn
label_desc: Use image node_id 5 for calling the TestDecoderModel obj's underlying member method code with example usage: obj.forward(sample_list) and returns: model_output