code: def _single_task_save(
      file_prefix: tensor_lib.Tensor,
      tensor_slice_dict: sharding_util.TensorSliceDict,
      options: "checkpoint_options.CheckpointOptions | None" = None,
  ) -> ops.Operation:
      """Save the saveable objects to a checkpoint with `file_prefix`.
  
      Args:
        file_prefix: A string or scalar string Tensor containing the prefix to
          save under.
        tensor_slice_dict: A dict mapping checkpoint key -> slice_spec -> tensor.
          Tensors in this structure must belong to the same task, but may belong to
          different devices within that task.
        options: Optional `CheckpointOptions` object.
  
      Returns:
        An `Operation`, or None when executing eagerly.
      """
      options = options or checkpoint_options.CheckpointOptions()
      tensor_names = []
      tensors = []
      slice_specs = []
      for checkpoint_key, tensor_slices in tensor_slice_dict.items():
          for slice_spec, tensor in tensor_slices.items():
              if isinstance(tensor, saveable_object.SaveSpec):
                  tensor_value = tensor.tensor
                  # A tensor value of `None` indicates that this SaveableObject gets
                  # recorded in the object graph, but that no value is saved in the
                  # checkpoint.
                  if tensor_value is not None:
                      tensor_names.append(tensor.name)
                      tensors.append(tensor_value)
                      slice_specs.append(tensor.slice_spec)
              else:
                  tensor_names.append(checkpoint_key)
                  tensors.append(tensor)
                  slice_specs.append(slice_spec)
      save_device_spec = options.experimental_io_device or (
          len(tensors)
          and saveable_object_util.set_cpu0(tensors[0].device)
      )
      save_device_spec = save_device_spec or "cpu:0"
      with ops.device(save_device_spec):
          return io_ops.save_v2(
              file_prefix, tensor_names, slice_specs, tensors
          )
  
imports: from typing import Callable, Mapping, Sequence
  from tensorflow.core.protobuf import saver_pb2
  from tensorflow.python.checkpoint import checkpoint_options
  from tensorflow.python.checkpoint.sharding import sharding_util
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_io_ops
  from tensorflow.python.ops import io_ops
  from tensorflow.python.ops import string_ops
  from tensorflow.python.saved_model import registration
  from tensorflow.python.trackable import base
  from tensorflow.python.trackable import trackable_utils
  from tensorflow.python.training.saving import saveable_object
  from tensorflow.python.training.saving import saveable_object_util
  from tensorflow.python.types import core
  from tensorflow.python.util import nest
  from tensorflow.python.util import object_identity
label_desc: Use image node_id 1 for calling a global function with example usage: _single_task_save(file_prefix, tensor_slice_dict, options) and returns: io_ops