docstr: Get batch data from inputs.
  
  Args:
      inputs (Iterable): An iterable dataset.
      chunk_size (int): Equivalent to batch size.
  
  Yields:
      list: batch data.
docstr_tok: ["Get","batch","data","from","inputs",".","Args",":","inputs","(","Iterable",")",":","An","iterable","dataset",".","chunk_size","(","int",")",":","Equivalent","to","batch","size",".","Yields",":","list",":","batch","data","."]
code: def _get_chunk_data(
      self, inputs: Iterable, pipeline, chunk_size: int
  ):
      """Get batch data from inputs.
  
      Args:
          inputs (Iterable): An iterable dataset.
          chunk_size (int): Equivalent to batch size.
  
      Yields:
          list: batch data.
      """
      inputs_iter = iter(inputs)
      while True:
          try:
              chunk_data = []
              for _ in range(chunk_size):
                  inputs_ = next(inputs_iter)
                  chunk_data.append(
                      (inputs_, pipeline(copy.deepcopy(inputs_)))
                  )
              yield chunk_data
          except StopIteration:
              if chunk_data:
                  yield chunk_data
              break
  
file_path: mmdetection/projects/XDecoder/xdecoder/inference/texttoimage_regionretrieval_inferencer.py
imports: import copy
  from typing import Iterable, Optional, Union
  import torch
  from mmengine.dataset import Compose
  from rich.progress import track
  from mmdet.apis.det_inferencer import DetInferencer, InputsType
  from mmdet.utils import ConfigType
label_desc: Use image node_id 2 for calling the TextToImageRegionRetrievalInferencer obj's underlying member method code with example usage: obj._get_chunk_data(inputs, pipeline, chunk_size) without return types