code: def torch_wrapper(self, batch_processing, function, device, *args):
      func = (
          function
          if device == "cpu"
          else lambda *ins: self._torch_stream_wrapper(function, *ins)
      )
      if batch_processing:
          return ops.PythonFunction.function_wrapper_batch(
              self.pipeline,
              func,
              self.num_outputs,
              torch.utils.dlpack.from_dlpack,
              torch.utils.dlpack.to_dlpack,
              *args,
          )
      else:
          return ops.PythonFunction.function_wrapper_per_sample(
              self.pipeline,
              func,
              self.num_outputs,
              torch_dlpack.from_dlpack,
              torch_dlpack.to_dlpack,
              *args,
          )
  
file_path: DALI/dali/python/nvidia/dali/plugin/pytorch/_torch_function.py
imports: import torch
  import torch.utils.dlpack
  from nvidia.dali import ops
  from nvidia.dali.pipeline import Pipeline
label_desc: Use image node_id 2 for calling the TorchPythonFunction obj's underlying member method code with example usage: obj.torch_wrapper(batch_processing, function, device) and returns: ops, ops