class_docstr: This class is used to encapsulate the following functions of an `InputTransform` Object:
  Inside a worker:
      per_sample_transform: Function to transform an individual sample
      collate: Function to merge sample into a batch
      per_batch_transform: Function to transform an individual batch
  
  Inside main process:
      per_sample_transform_on_device: Function to transform an individual sample
      collate: Function to merge sample into a batch
      per_batch_transform_on_device: Function to transform an individual batch
class_docstr_tok: ["This","class","is","used","to","encapsulate","the","following","functions","of","an","`","InputTransform","`","Object",":","Inside","a","worker",":","per_sample_transform",":","Function","to","transform","an","individual","sample","collate",":","Function","to","merge","sample","into","a","batch","per_batch_transform",":","Function","to","transform","an","individual","batch","Inside","main","process",":","per_sample_transform_on_device",":","Function","to","transform","an","individual","sample","collate",":","Function","to","merge","sample","into","a","batch","per_batch_transform_on_device",":","Function","to","transform","an","individual","batch"]
code: def __init__(
      self,
      input_transform: InputTransform,
      collate_fn: Callable,
      per_sample_transform: Callable,
      per_batch_transform: Callable,
      stage: RunningStage,
      apply_per_sample_transform: bool = True,
      on_device: bool = False,
  ):
      super().__init__()
      self.input_transform = input_transform
      self.callback = ControlFlow(self.input_transform.callbacks or [])
      self.collate_fn = collate_fn
      self.per_sample_transform = per_sample_transform
      self.per_batch_transform = per_batch_transform
      self.apply_per_sample_transform = apply_per_sample_transform
      self.stage = stage
      self.on_device = on_device
  
imports: import inspect
  from dataclasses import dataclass
  from functools import partial
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple
  from pytorch_lightning.utilities import rank_zero_warn
  from pytorch_lightning.utilities.enums import LightningEnum
  from flash.core.data.callback import ControlFlow
  from flash.core.data.utilities.collate import default_collate
  from flash.core.data.utils import _STAGES_PREFIX
  from flash.core.utilities.stages import RunningStage
  from flash.core.utilities.types import INPUT_TRANSFORM_TYPE
label_desc: Use image node_id 1 to create a new _InputTransformProcessor object  with example: obj = _InputTransformProcessor(input_transform, collate_fn, per_sample_transform, per_batch_transform, stage, apply_per_sample_transform, on_device)