code: def _test_vs_scipy(device, batch_size, num_dims, in_type, out_type):
      shape = (30,) * num_dims
      # scipy supports only windows of size 3 and does not use smoothing
      window_size, smoothing_size = 3, 1
      data = RandomlyShapedDataIterator(
          batch_size, max_shape=shape, dtype=in_type
      )
  
      @pipeline_def
      def pipeline():
          if out_type == np.float32:
              dtype_args = {"dtype": types.FLOAT}
          else:
              dtype_args = {}
          input = fn.external_source(data)
          if device == "gpu":
              input = input.gpu()
          edges = fn.laplacian(
              input,
              window_size=window_size,
              device=device,
              smoothing_size=smoothing_size,
              **dtype_args,
          )
          return edges, input
  
      pipe = pipeline(device_id=0, num_threads=4, batch_size=batch_size)
      pipe.build()
  
      for _ in range(test_iters):
          edges, input = pipe.run()
          if device == "gpu":
              edges = edges.as_cpu()
              input = input.as_cpu()
          edges = to_batch(edges, batch_size)
          input = to_batch(input, batch_size)
          baseline = laplacian_sp(input, out_type)
          max_error = 1e-6
          check_batch(
              edges, baseline, batch_size, max_allowed_error=max_error
          )
  
imports: from nvidia.dali.pipeline import pipeline_def
  import nvidia.dali.types
  import nvidia.dali.fn
  import numpy
  import cv2
  from scipy.ndimage import convolve1d, filters
  import os
  from nose_utils import assert_raises
  from nose.plugins.attrib import attr
  from sequences_test_utils import video_suite_helper, ArgCb
  from test_utils import get_dali_extra_path, check_batch, RandomlyShapedDataIterator
label_desc: Use image node_id 11 for calling a global function with example usage: _test_vs_scipy(device, batch_size, num_dims, in_type, out_type) and returns: edges,  input