code: def sample_pipeline(
      sample_shapes,
      sample_layout,
      filter_shapes,
      border,
      in_dtype,
      mode,
      dev,
  ):
      samples = fn.external_source(
          source=create_sample_source(sample_shapes, in_dtype),
          batch=False,
          layout=sample_layout,
      )
      filters, anchors = fn.external_source(
          source=create_filter_anchor_source(filter_shapes),
          batch=False,
          num_outputs=2,
      )
      fill_val_limit = (
          1
          if not np.issubdtype(in_dtype, np.integer)
          else np.iinfo(in_dtype).max
      )
      rand_fill_dtype = (
          in_dtype if in_dtype != np.float16 else np.float32
      )
      fill_values = fn.random.uniform(
          range=[0, fill_val_limit],
          dtype=np_type_to_dali(rand_fill_dtype),
      )
      fill_values = fn.cast_like(fill_values, samples)
      in_samples = samples.gpu() if dev == "gpu" else samples
      if border == "constant":
          convolved = fn.experimental.filter(
              in_samples,
              filters,
              fill_values,
              anchor=anchors,
              border=border,
              mode=mode,
          )
      else:
          convolved = fn.experimental.filter(
              in_samples,
              filters,
              anchor=anchors,
              border=border,
              mode=mode,
          )
      return convolved, samples, filters, anchors, fill_values
  
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 5 for calling a global function with example usage: sample_pipeline(sample_shapes, sample_layout, filter_shapes, border, in_dtype, mode, dev) and returns: convolved,  samples,  filters,  anchors,  fill_values