class_docstr: Inference engine subclass to run inference with ctranslate2.
  
  Args:
      opt: inference options
class_docstr_tok: ["Inference","engine","subclass","to","run","inference","with","ctranslate2",".","Args",":","opt",":","inference","options"]
code: def _translate(self, infer_iter):
      scores = []
      preds = []
      for batch, bucket_idx in infer_iter:
          _scores, _preds = self.translate_batch(batch, self.opt)
          scores += _scores
          preds += _preds
      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 3 for calling the InferenceEngineCT2 obj's underlying member method code with example usage: obj._translate(infer_iter) and returns: scores,  preds