code: def graph_save_fail():
      """Serial ops is expected to raise an exception when
      trying to save in graph mode."""
      savefolder = tempfile.TemporaryDirectory()
      savepath = os.path.join(savefolder.name, "temp_dataset")
      tfrecord_path = savepath + ".tfrecord"
      header_path = savepath + ".header"
  
      # Data
      x = np.linspace(1, 3000, num=3000).reshape(10, 10, 10, 3)
      y = np.linspace(1, 10, num=10).astype(int)
      ds = tf.data.Dataset.from_tensor_slices({"image": x, "label": y})
  
      # Run
      assert os.path.isdir(savefolder.name)
      assert not tf.executing_eagerly()
      tfio.experimental.serialization.save_dataset(
          ds, tfrecord_path=tfrecord_path, header_path=header_path
      )
  
file_path: io/tests/test_serial_ops.py
imports: import os
  import tempfile
  import numpy
  import pytest
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 2 for calling a global function with example usage: graph_save_fail() without return types