code: def test_image_decoder_fused():
      threads = 4
      batch_size = 10
      for test_fun in [
          create_decoder_slice_pipeline,
          create_decoder_crop_pipeline,
          create_decoder_random_crop_pipeline,
      ]:
          # before CUDA 11.4 HW decoder API doesn't support ROI so we get slightly different results
          # HW decoder + slice vs fused which in this case is executed by the hybrid backend
          if (
              test_fun == create_decoder_random_crop_pipeline
              or nvidia.dali.backend.GetNvjpegVersion() < 11040
          ):
              # random_resized_crop can properly handle border as it has pixels that are cropped out,
              # while plain resize following image_decoder_random_crop cannot do that
              # and must duplicate the border pixels
              def mean_close(x, y):
                  return np.mean(np.abs(x - y) < 0.5)
  
              validation_fun = mean_close
          else:
  
              def mean_close(x, y):
                  return np.allclose(x, y)
  
              validation_fun = mean_close
          for device in {"cpu", "mixed"}:
              for img_type in test_good_path:
                  yield (
                      run_decode_fused,
                      test_fun,
                      good_path,
                      img_type,
                      batch_size,
                      device,
                      threads,
                      validation_fun,
                  )
  
imports: import glob
  import math
  import numpy
  import nvidia.dali.backend
  import nvidia.dali.fn
  import nvidia.dali.types
  import os
  import random
  from nvidia.dali import pipeline_def
  from nose2.tools import params
  from nose_utils import assert_raises
  from test_utils import check_output_pattern
  from test_utils import compare_pipelines
  from test_utils import get_dali_extra_path
  from test_utils import to_array
label_desc: Use image node_id 9 for calling a global function with example usage: test_image_decoder_fused() and returns: np, np