code: def test_to_proto(self):
      v1 = resource_variable_ops.ResourceVariable(2.0)
      saver = functional_saver.MultiDeviceSaver.from_saveables(
          saveable_object_util.saveable_objects_for_op(v1, "x")
      )
      prefix = os.path.join(self.get_temp_dir(), "ckpt")
  
      proto_accumulator = []
      wrapped = wrap_function.wrap_function(
          lambda: proto_accumulator.append(saver.to_proto()),
          signature=(),
      )
      self.assertEqual(1, len(proto_accumulator))
      proto = proto_accumulator[0]
      save = wrapped.prune(
          feeds=wrapped.graph.get_tensor_by_name(
              proto.filename_tensor_name
          ),
          fetches=wrapped.graph.get_tensor_by_name(
              proto.save_tensor_name
          ),
      )
      restore = wrapped.prune(
          feeds=wrapped.graph.get_tensor_by_name(
              proto.filename_tensor_name
          ),
          fetches=wrapped.graph.get_operation_by_name(
              proto.restore_op_name
          ),
      )
      save_path = save(constant_op.constant(prefix))
      v1.assign(1.0)
      restore(constant_op.constant(save_path))
      self.assertEqual(2.0, self.evaluate(v1))
  
      v2 = resource_variable_ops.ResourceVariable(3.0)
      second_saver = functional_saver.MultiDeviceSaver.from_saveables(
          saveable_object_util.saveable_objects_for_op(v2, "x")
      )
      second_saver.restore(save_path)
      self.assertEqual(2.0, self.evaluate(v2))
  
imports: import os
  import time
  from tensorflow.python.checkpoint import checkpoint
  from tensorflow.python.checkpoint import checkpoint_options
  from tensorflow.python.checkpoint import functional_saver
  from tensorflow.python.checkpoint import graph_view
  from tensorflow.python.eager import context
  from tensorflow.python.eager import remote
  from tensorflow.python.eager import test
  from tensorflow.python.eager import wrap_function
  from tensorflow.python.framework import config
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.module import module
  from tensorflow.python.ops import gen_io_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.platform import gfile
  from tensorflow.python.training import server_lib
  from tensorflow.python.training.saving import saveable_object_util
label_desc: Use image node_id 5 for calling the SaverTest obj's underlying member method code with example usage: obj.test_to_proto() without return types