code: def init_batch(self, sample_list):
      self.sample_list = super().init_batch(sample_list)
  
      # initialize with t_batch_size = _batch_size * _decode_size
      self.top_k_scores = sample_list.answers.new_zeros(
          (self._batch_size * self._decode_size, 1), dtype=torch.float
      )
      # maintain _decode_size, _complete_seqs and _complete_seqs_scores
      # for each example in a batch.
      self._decode_sizes = [self._decode_size] * self._batch_size
      for _ in range(self._batch_size):
          self._complete_seqs.append([])
          self._complete_seqs_scores.append([])
      return self.sample_list
  
imports: import os
  import re
  from collections import Counter
  from itertools import chain
  import torch
  from mmf.common.registry import registry
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_absolute_path
label_desc: Use image node_id 2 for calling the BeamSearch obj's underlying member method code with example usage: obj.init_batch(sample_list) and returns: self