code: def pytorch_compare(fun, pre1, pre2, post1, post2):
      torch_pre1 = [
          torch.from_numpy(pre1.at(i)) for i in range(BATCH_SIZE)
      ]
      torch_pre2 = [
          torch.from_numpy(pre2.at(i)) for i in range(BATCH_SIZE)
      ]
      torch_post1, torch_post2 = fun(torch_pre1, torch_pre2)
      for i in range(BATCH_SIZE):
          assert numpy.array_equal(post1.at(i), torch_post1[i].numpy())
          assert numpy.array_equal(post2.at(i), torch_post2[i].numpy())
  
imports: import numpy
  import nvidia.dali.ops
  import nvidia.dali.types
  import os
  import random
  from functools import partial
  from nvidia.dali.pipeline import Pipeline
  from nvidia.dali import fn, pipeline_def
  from nvidia.dali.python_function_plugin import current_dali_stream
label_desc: Use image node_id 8 for calling a global function with example usage: pytorch_compare(fun, pre1, pre2, post1, post2) without return types