code: def slow_test_samples(
      dev,
      dtype,
      sample_layout,
      sample_shapes,
      filter_shapes,
      batch_size,
      border,
      mode,
  ):
      num_iters = 2
  
      pipe = sample_pipeline(
          batch_size=batch_size,
          num_threads=4,
          device_id=0,
          sample_shapes=sample_shapes,
          sample_layout=sample_layout,
          filter_shapes=filter_shapes,
          border=border,
          in_dtype=dtype,
          mode=mode,
          dev=dev,
      )
      pipe.build()
      if dtype == np.float32:
          atol = 1e-5
      elif dtype == np.float16:
          atol = 1e-2
      else:
          assert np.issubdtype(dtype, np.integer)
          atol = 1
      for _ in range(num_iters):
          (
              flt_samples,
              samples,
              kernels,
              anchors,
              fill_values,
          ) = pipe.run()
          if dev == "gpu":
              flt_samples = flt_samples.as_cpu()
          flt_samples = [np.array(img) for img in flt_samples]
          samples = [np.array(sample) for sample in samples]
          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(flt_samples)
              == len(samples)
              == len(kernels)
              == len(anchors)
              == len(fill_values)
          )
          baseline = [
              filter_baseline_layout(
                  sample_layout,
                  sample,
                  kernel,
                  anchor,
                  border,
                  fill_value,
                  mode,
              )
              for sample, kernel, anchor, fill_value in zip(
                  samples, kernels, anchors, fill_values
              )
          ]
          check_batch(flt_samples, 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 7 for calling a global function with example usage: slow_test_samples(dev, dtype, sample_layout, sample_shapes, filter_shapes, batch_size, border, mode) without return types