code: def test_transpose_layout():
      batch_size = 3
      for device in {"cpu", "gpu"}:
          for batch_size in (1, 3):
              for shape in [(600, 400, 3), (600, 400, 1)]:
                  for (
                      permutation,
                      in_layout,
                      transpose_layout,
                      out_layout_arg,
                  ) in [
                      ((2, 0, 1), "HWC", True, None),
                      ((2, 0, 1), "HWC", True, "CHW"),
                      ((2, 0, 1), "HWC", False, "CHW"),
                      ((1, 0, 2), None, False, None),
                      ((1, 0, 2), "XYZ", True, None),
                      ((1, 0, 2), None, None, "ABC"),
                  ]:
                      yield (
                          check_transpose_layout,
                          device,
                          batch_size,
                          shape,
                          in_layout,
                          permutation,
                          transpose_layout,
                          out_layout_arg,
                      )
  
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 6 for calling a global function with example usage: test_transpose_layout() without return types