class_docstr: Wrapper Class to run Inference.
  
  Args:
      opt: inference options
class_docstr_tok: ["Wrapper","Class","to","run","Inference",".","Args",":","opt",":","inference","options"]
docstr: List of strings inference `src`
docstr_tok: ["List","of","strings","inference","`","src","`"]
code: def infer_list(self, src):
      """List of strings inference `src`"""
      if self.opt.world_size <= 1:
          infer_iter = build_dynamic_dataset_iter(
              self.opt,
              self.transforms_cls,
              self.vocabs,
              task=CorpusTask.INFER,
              src=src,
              device_id=self.device_id,
          )
          scores, preds = self._translate(infer_iter)
      else:
          scores, preds = self.infer_list_parallel(src)
      return scores, preds
  
imports: import json
  from onmt.constants import CorpusTask, DefaultTokens, ModelTask
  from onmt.inputters.dynamic_iterator import build_dynamic_dataset_iter
  from onmt.utils.distributed import ErrorHandler, spawned_infer
  from onmt.utils.logging import init_logger
  from onmt.transforms import get_transforms_cls, make_transforms, TransformPipe
label_desc: Use image node_id 5 for calling the InferenceEngine obj's underlying member method code with example usage: obj.infer_list(src) and returns: scores,  preds