code: def test_dali_tf_dataset_cpu_only():
      skip_for_incompatible_tf()
      try:
          tf.compat.v1.enable_eager_execution()
      except Exception:
          pass
  
      batch_size = 3
      value = random.randint(0, 1000)
      pipe = get_dali_pipe(
          batch_size=batch_size,
          device_id=types.CPU_ONLY_DEVICE_ID,
          num_threads=1,
          value=value,
      )
      with tf.device("/cpu"):
          ds = dali_tf.DALIDataset(
              pipe,
              device_id=types.CPU_ONLY_DEVICE_ID,
              batch_size=1,
              output_dtypes=tf.int32,
              output_shapes=[1],
          )
      ds = iter(ds)
      data = next(ds)
      assert data == np.array([value])
  
file_path: DALI/dali/test/python/test_dali_tf_plugin_cpu_only_dataset.py
imports: import nose_utils
  from nvidia.dali.pipeline import pipeline_def
  import nvidia.dali.types
  import nvidia.dali.plugin.tf
  from test_utils_tensorflow import skip_for_incompatible_tf
  import tensorflow
  import random
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: test_dali_tf_dataset_cpu_only() without return types