code: def test_image_pipeline(dev, dtype, batch_size, border, mode):
      shapes = [
          (3, 3),
          (8, 8),
          (31, 1),
          (1, 31),
          (1, 1),
          (51, 3),
          (3, 51),
          (2, 40),
          (2, 40),
          (2, 2),
          (27, 27),
      ]
      num_iters = 2
  
      pipe = images_pipeline(
          batch_size=batch_size,
          num_threads=4,
          device_id=0,
          border=border,
          in_dtype=dtype,
          shapes=shapes,
          mode=mode,
          dev=dev,
      )
      pipe.build()
      atol = 1 if np.issubdtype(dtype, np.integer) else 1e-5
      for _ in range(num_iters):
          (
              filtered_imgs,
              imgs,
              kernels,
              anchors,
              fill_values,
          ) = pipe.run()
          if dev == "gpu":
              filtered_imgs = filtered_imgs.as_cpu()
              imgs = imgs.as_cpu()
          filtered_imgs = [np.array(img) for img in filtered_imgs]
          imgs = [np.array(img) for img in imgs]
          kernels = [np.array(kernel) for kernel in kernels]
          anchors = [np.array(anchor) for anchor in anchors]
          fill_values = [np.array(fv) for fv in fill_values]
          assert (
              len(filtered_imgs)
              == len(imgs)
              == len(kernels)
              == len(anchors)
              == len(fill_values)
          )
          baseline = [
              filter_baseline(
                  img,
                  kernel,
                  anchor,
                  border,
                  fill_value,
                  mode,
                  has_channels=True,
              )
              for img, kernel, anchor, fill_value in zip(
                  imgs, kernels, anchors, fill_values
              )
          ]
          check_batch(filtered_imgs, baseline, max_allowed_error=atol)
  
file_path: DALI/dali/test/python/operator_2/test_filter.py
imports: import itertools
  import os
  import numpy
  from nvidia.dali import pipeline_def, fn, types
  from test_utils import get_dali_extra_path, np_type_to_dali, check_batch
  from nose2.tools import params
  from nose.plugins.attrib import attr
  from filter_test_utils import filter_baseline, filter_baseline_layout
label_desc: Use image node_id 6 for calling a global function with example usage: test_image_pipeline(dev, dtype, batch_size, border, mode) without return types