code: def test_runtime_stride_dim1():
      def data_gen():
          return [
              np.arange(12, dtype=np.float32).reshape(4, 3),
              np.arange(20, dtype=np.float32).reshape(4, 5),
          ]
  
      src = fn.external_source(data_gen)
      strides = [
          np.array(x, dtype=np.int64) for x in [1, 2, -1, -2, -5]
      ]
      stride = fn.external_source(
          source=strides, batch=False, cycle=True
      )
      pipe = index_pipe(src, lambda x: x[::stride])
      pipe.build()
  
      j = 0
      for _ in range(4):
          inp, cpu, gpu = pipe.run()
          for i in range(len(inp)):
              x = inp.at(i)
              # fmt: off
              ref = x[::strides[j]]
              # fmt: on
              assert np.array_equal(ref, cpu.at(i))
              assert np.array_equal(ref, gpu.as_cpu().at(i))
              j = (j + 1) % len(strides)
  
imports: from nvidia import dali
  from nvidia.dali import fn
  import numpy
  from nvidia.dali.pipeline import Pipeline
  from nose_utils import assert_raises
label_desc: Use image node_id 8 for calling a global function with example usage: test_runtime_stride_dim1() and returns: list