code: def check_tensor_input_fail(
      device,
      batch_size,
      shape,
      layout,
      window_size,
      smoothing_size,
      scale,
      normalize,
      dtype,
      err_regex,
  ):
      iterator = RandomlyShapedDataIterator(
          batch_size, max_shape=shape, dtype=np.uint8
      )
  
      def gen_params():
          return (
              np.array(window_size, dtype=np.int32),
              np.array(smoothing_size, dtype=np.int32),
              np.array(scale, dtype=np.float32),
          )
  
      @pipeline_def
      def pipeline():
          data = fn.external_source(iterator, layout=layout)
          window_size, smoothing_size, scale = fn.external_source(
              gen_params, batch=False, num_outputs=3
          )
          if device == "gpu":
              data = data.gpu()
          edges = fn.laplacian(
              data,
              window_size=window_size,
              smoothing_size=smoothing_size,
              scale=scale,
              normalized_kernel=normalize,
              dtype=dtype,
              device=device,
          )
          return edges, data
  
      with assert_raises(RuntimeError, regex=err_regex):
          pipe = pipeline(
              device_id=0, num_threads=4, batch_size=batch_size
          )
          pipe.build()
          pipe.run()
  
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 26 for calling a global function with example usage: check_tensor_input_fail(device, batch_size, shape, layout, window_size, smoothing_size, scale, normalize, dtype, err_regex) and returns: np,  np,  np, edges,  data