code: def check_pytorch_operator(device):
      pipe = BasicPipeline()
      pt_pipe = TorchPythonFunctionPipeline(torch_operation, device)
      pipe.build()
      pt_pipe.build()
      for it in range(ITERS):
          (preprocessed_output,) = pipe.run()
          output1, output2 = pt_pipe.run()
          if device == "gpu":
              output1 = output1.as_cpu()
              output2 = output2.as_cpu()
          for i in range(len(output1)):
              res1 = output1.at(i)
              res2 = output2.at(i)
              exp1_t, exp2_t = torch_operation(
                  torch.from_numpy(preprocessed_output.at(i))
              )
              assert numpy.allclose(res1, exp1_t.numpy())
              assert numpy.allclose(res2, exp2_t.numpy())
  
imports: import numpy
  import nvidia.dali.ops
  import nvidia.dali.plugin.pytorch
  import nvidia.dali.types
  import os
  import torch
  from nvidia.dali.pipeline import Pipeline
  from test_utils import get_dali_extra_path
label_desc: Use image node_id 3 for calling a global function with example usage: check_pytorch_operator(device) without return types