code: def check_transpose_vs_numpy(
      device, batch_size, dim, total_volume, permutation
  ):
      max_shape = [
          int(math.pow(total_volume / batch_size, 1 / dim))
      ] * dim
      print(
          "Testing",
          device,
          "backend with batch of",
          batch_size,
          "max size",
          max_shape,
      )
      print("permutation ", permutation)
      eii1 = RandomlyShapedDataIterator(batch_size, max_shape=max_shape)
      eii2 = RandomlyShapedDataIterator(batch_size, max_shape=max_shape)
      compare_pipelines(
          TransposePipeline(
              device,
              batch_size,
              "",
              iter(eii1),
              permutation=permutation,
          ),
          PythonOpPipeline(
              lambda x: transpose_func(x, permutation),
              batch_size,
              "",
              iter(eii2),
          ),
          batch_size=batch_size,
          N_iterations=3,
      )
  
imports: from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops
  from nvidia.dali import fn, pipeline_def
  import math
  from test_utils import compare_pipelines, as_array, RandomDataIterator, RandomlyShapedDataIterator
  import itertools
  from nose2.tools import params
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: check_transpose_vs_numpy(device, batch_size, dim, total_volume, permutation) without return types