code: def plugin_load_and_test(dali_tf_path):
      # Make sure that TF won't try using CUDA
      os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
  
      from nvidia.dali.pipeline import pipeline_def
      import nvidia.dali.types as types
      import tensorflow as tf
  
      try:
          from tensorflow.compat.v1 import Session
      except Exception:
          # Older TF versions don't have compat.v1 layer
          from tensorflow import Session
  
      try:
          tf.compat.v1.disable_eager_execution()
      except Exception:
          pass
  
      @pipeline_def()
      def get_dali_pipe():
          data = types.Constant(1)
          return data
  
      _dali_tf_module = tf.load_op_library(dali_tf_path)
      _dali_tf = _dali_tf_module.dali
  
      def get_data():
          batch_size = 3
          pipe = get_dali_pipe(
              batch_size=batch_size,
              device_id=types.CPU_ONLY_DEVICE_ID,
              num_threads=1,
          )
  
          out = []
          with tf.device("/cpu"):
              data = _dali_tf(
                  serialized_pipeline=pipe.serialize(),
                  shapes=[(batch_size,)],
                  dtypes=[tf.int32],
                  device_id=types.CPU_ONLY_DEVICE_ID,
                  batch_size=batch_size,
                  exec_separated=False,
                  gpu_prefetch_queue_depth=2,
                  cpu_prefetch_queue_depth=2,
              )
              out.append(data)
          return [out]
  
      test_batch = get_data()
      with Session() as sess:
          for _ in range(3):
              print(sess.run(test_batch))
  
imports: import platform
  from shutil import copyfile
  from dali_tf_plugin_utils import get_module_path, is_conda_env, get_tf_version, get_tf_compiler_version, get_cpp_compiler, get_cpp_compiler_version, which, find, find_available_prebuilt_tf, get_cuda_build_flags, get_tf_build_flags
  import os
  from distutils.version import StrictVersion, LooseVersion
  from pathlib import Path
  import tempfile
  from stubgen import stubgen
  from multiprocessing import Process
  import subprocess
label_desc: Use image node_id 1 for calling a global function with example usage: plugin_load_and_test(dali_tf_path) and returns: data, list