code: def test_single_task_save_singlehost_multidevice(self):
      root = module.Module()
      with ops.device("cpu:0"):
          v0 = resource_variable_ops.ResourceVariable(0.0)
      with ops.device("cpu:1"):
          v1 = resource_variable_ops.ResourceVariable(1.0)
      with ops.device("cpu:2"):
          v2 = resource_variable_ops.ResourceVariable(2.0)
      root.v0 = v0
      root.v1 = v1
      root.v2 = v2
  
      tensors_by_task = self._get_tensors_by_task(root)
      var_names = [
          "v0/.ATTRIBUTES/VARIABLE_VALUE",
          "v1/.ATTRIBUTES/VARIABLE_VALUE",
          "v2/.ATTRIBUTES/VARIABLE_VALUE",
      ]
      vars_numpy = [v0.numpy(), v1.numpy(), v2.numpy()]
      tmp_dir = self.get_temp_dir()
  
      for device in ["cpu:0", "cpu:1", "cpu:2"]:
          for shard, (_, tensor_slice_dict) in enumerate(
              sorted(tensors_by_task.items())[1:]
          ):
              with ops.device(device):
                  shard_prefix = gen_io_ops.sharded_filename(
                      os.path.join(tmp_dir, str(shard)), shard, 3
                  )
                  functional_saver._single_task_save(
                      shard_prefix, tensor_slice_dict
                  )
  
              start_time = time.time()
              max_save_time = start_time + 5  # seconds
              while not (
                  gfile.ListDirectory(tmp_dir)
                  or time.time() > max_save_time
              ):
                  pass  # eager execution is lovely
              self.assertNotEmpty(gfile.ListDirectory(tmp_dir))
  
              with ops.device(device):
                  restored_dict = functional_saver._single_task_restore(
                      shard_prefix, tensor_slice_dict
                  )
                  self.evaluate(restored_dict)
                  self.assertEqual(
                      restored_dict[var_names[shard]][""].numpy(),
                      vars_numpy[shard],
                  )
  
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 8 for calling the SaverTest obj's underlying member method code with example usage: obj.test_single_task_save_singlehost_multidevice() without return types