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 __call__(self, samples: Sequence[Any]) -> Any:
      if not self.on_device:
          for sample in samples:
              self.callback.on_load_sample(sample, self.stage)
  
      if self.apply_per_sample_transform:
          list_samples = (
              [samples] if not isinstance(samples, list) else samples
          )
  
          transformed_samples = [
              self.per_sample_transform(sample, self.stage)
              for sample in list_samples
          ]
  
          for sample in transformed_samples:
              if self.on_device:
                  self.callback.on_per_sample_transform_on_device(
                      sample, self.stage
                  )
              else:
                  self.callback.on_per_sample_transform(
                      sample, self.stage
                  )
  
          collated_samples = self.collate_fn(
              transformed_samples, self.stage
          )
          self.callback.on_collate(collated_samples, self.stage)
      else:
          collated_samples = samples
  
      transformed_collated_samples = self.per_batch_transform(
          collated_samples, self.stage
      )
      if self.on_device:
          self.callback.on_per_batch_transform_on_device(
              transformed_collated_samples, self.stage
          )
      else:
          self.callback.on_per_batch_transform(
              transformed_collated_samples, self.stage
          )
      return transformed_collated_samples
  
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 2 for calling the _InputTransformProcessor obj's underlying member method code with example usage: obj.__call__(samples) and returns: transformed_collated_samples