class_docstr: Perform inverse on a batch of data. This is useful if you have inferred a batch of images and want to invert
  them all.
class_docstr_tok: ["Perform","inverse","on","a","batch","of","data",".","This","is","useful","if","you","have","inferred","a","batch","of","images","and","want","to","invert","them","all","."]
docstr: Args:
      transform: a callable data transform on input data.
      loader: data loader used to run `transforms` and generate the batch of data.
      collate_fn: how to collate data after inverse transformations.
          default won't do any collation, so the output will be a list of size batch size.
      num_workers: number of workers when run data loader for inverse transforms,
          default to 0 as only run 1 iteration and multi-processing may be even slower.
          if the transforms are really slow, set num_workers for multi-processing.
          if set to `None`, use the `num_workers` of the transform data loader.
      detach: whether to detach the tensors. Scalars tensors will be detached into number types
          instead of torch tensors.
      pad_batch: when the items in a batch indicate different batch size,
          whether to pad all the sequences to the longest.
          If False, the batch size will be the length of the shortest sequence.
      fill_value: the value to fill the padded sequences when `pad_batch=True`.
docstr_tok: ["Args",":","transform",":","a","callable","data","transform","on","input","data",".","loader",":","data","loader","used","to","run","`","transforms","`","and","generate","the","batch","of","data",".","collate_fn",":","how","to","collate","data","after","inverse","transformations",".","default","wo","n't","do","any","collation",",","so","the","output","will","be","a","list","of","size","batch","size",".","num_workers",":","number","of","workers","when","run","data","loader","for","inverse","transforms",",","default","to","0","as","only","run","1","iteration","and","multi-processing","may","be","even","slower",".","if","the","transforms","are","really","slow",",","set","num_workers","for","multi-processing",".","if","set","to","`","None","`",",","use","the","`","num_workers","`","of","the","transform","data","loader",".","detach",":","whether","to","detach","the","tensors",".","Scalars","tensors","will","be","detached","into","number","types","instead","of","torch","tensors",".","pad_batch",":","when","the","items","in","a","batch","indicate","different","batch","size",",","whether","to","pad","all","the","sequences","to","the","longest",".","If","False",",","the","batch","size","will","be","the","length","of","the","shortest","sequence",".","fill_value",":","the","value","to","fill","the","padded","sequences","when","`","pad_batch=True","`","."]
code: def __init__(
      self,
      transform: InvertibleTransform,
      loader: TorchDataLoader,
      collate_fn: Callable | None = no_collation,
      num_workers: int | None = 0,
      detach: bool = True,
      pad_batch: bool = True,
      fill_value=None,
  ) -> None:
      """
      Args:
          transform: a callable data transform on input data.
          loader: data loader used to run `transforms` and generate the batch of data.
          collate_fn: how to collate data after inverse transformations.
              default won't do any collation, so the output will be a list of size batch size.
          num_workers: number of workers when run data loader for inverse transforms,
              default to 0 as only run 1 iteration and multi-processing may be even slower.
              if the transforms are really slow, set num_workers for multi-processing.
              if set to `None`, use the `num_workers` of the transform data loader.
          detach: whether to detach the tensors. Scalars tensors will be detached into number types
              instead of torch tensors.
          pad_batch: when the items in a batch indicate different batch size,
              whether to pad all the sequences to the longest.
              If False, the batch size will be the length of the shortest sequence.
          fill_value: the value to fill the padded sequences when `pad_batch=True`.
  
      """
      self.transform = transform
      self.batch_size = loader.batch_size
      self.num_workers = (
          loader.num_workers if num_workers is None else num_workers
      )
      self.collate_fn = collate_fn
      self.detach = detach
      self.pad_batch = pad_batch
      self.fill_value = fill_value
      self.pad_collation_used = (
          loader.collate_fn.__doc__ == pad_list_data_collate.__doc__
          or isinstance(loader.collate_fn, PadListDataCollate)
      )
  
imports: from __future__ import annotations
  import warnings
  from collections.abc import Callable, Sequence
  from typing import Any
  from torch.utils.data import Dataset
  from torch.utils.data.dataloader import DataLoader
  from monai.config import KeysCollection
  from monai.data.dataloader import DataLoader
  from monai.data.utils import decollate_batch, no_collation, pad_list_data_collate
  from monai.transforms.croppad.batch import PadListDataCollate
  from monai.transforms.inverse import InvertibleTransform
  from monai.transforms.transform import MapTransform, Transform
  from monai.utils import first
label_desc: Use image node_id 1 to create a new BatchInverseTransform object from inherited base classes: Transform with example: obj = BatchInverseTransform(transform, loader, collate_fn, num_workers, detach, pad_batch, fill_value)