code: def test_slice_synth_data_vs_numpy():
      for device in ["cpu", "gpu"]:
          for batch_size in {1, 8}:
              for (
                  input_shape,
                  layout,
                  axes,
                  axis_names,
                  input_type,
                  output_type,
              ) in [
                  ((200, 400, 3), "HWC", None, "WH", types.FLOAT, None),
                  ((200, 400, 3), "HWC", None, "HW", types.FLOAT, None),
                  (
                      (200, 400, 3),
                      "HWC",
                      None,
                      "HW",
                      types.INT32,
                      types.FLOAT,
                  ),
                  (
                      (200, 400, 3),
                      "HWC",
                      None,
                      "HW",
                      types.INT64,
                      types.UINT8,
                  ),
                  ((200, 400, 3), "HWC", None, "C", types.FLOAT, None),
                  (
                      (200, 400, 3),
                      "HWC",
                      (1, 0),
                      None,
                      types.FLOAT,
                      types.FLOAT16,
                  ),
                  (
                      (200, 400, 3),
                      "HWC",
                      (0, 1),
                      None,
                      types.FLOAT16,
                      types.FLOAT16,
                  ),
                  ((200, 400, 3), "HWC", (2,), None, types.FLOAT, None),
                  ((200,), "H", (0,), None, types.FLOAT, None),
                  ((200,), "H", None, "H", types.FLOAT, None),
                  ((200, 400), "HW", (1,), None, types.FLOAT, None),
                  ((200, 400), "HW", None, "W", types.FLOAT, None),
                  (
                      (80, 30, 20, 3),
                      "DHWC",
                      (2, 1, 0),
                      None,
                      types.FLOAT,
                      None,
                  ),
                  (
                      (80, 30, 20, 3),
                      "DHWC",
                      (0, 1, 2),
                      None,
                      types.FLOAT,
                      None,
                  ),
                  (
                      (80, 30, 20, 3),
                      "DHWC",
                      (2, 1),
                      None,
                      types.FLOAT,
                      None,
                  ),
                  (
                      (80, 30, 20, 3),
                      "DHWC",
                      None,
                      "WHD",
                      types.FLOAT,
                      None,
                  ),
                  (
                      (80, 30, 20, 3),
                      "DHWC",
                      None,
                      "DHW",
                      types.FLOAT,
                      None,
                  ),
                  (
                      (80, 30, 20, 3),
                      "DHWC",
                      None,
                      "WH",
                      types.FLOAT,
                      None,
                  ),
                  (
                      (80, 30, 20, 3),
                      "DHWC",
                      None,
                      "C",
                      types.FLOAT,
                      None,
                  ),
              ]:
                  normalized_anchor = np.random.choice([True, False])
                  normalized_shape = np.random.choice([True, False])
                  yield (
                      check_slice_synth_data_vs_numpy,
                      device,
                      batch_size,
                      input_shape,
                      layout,
                      axes,
                      axis_names,
                      normalized_anchor,
                      normalized_shape,
                      input_type,
                      output_type,
                  )
  
imports: from nvidia.dali import Pipeline, pipeline_def, ops, fn, types
  import numpy
  import os
  from functools import partial
  from math import floor
  from test_utils import compare_pipelines, get_dali_extra_path, RandomDataIterator, generator_random_axes_for_3d_input, generator_random_data, as_array
  from nose_utils import assert_raises
  from nose2.tools import params
label_desc: Use image node_id 5 for calling a global function with example usage: test_slice_synth_data_vs_numpy() without return types