code: def test_checkpoint_comparison(self):
      saveable_state = SaveableState(5.0)
      trackable_state = TrackableState(10.0)
  
      # First test that SaveableState and TrackableState are equivalent by
      # saving a checkpoint with both objects and swapping values.
  
      self.assertEqual(5, self.evaluate(saveable_state.read()))
      self.assertEqual(10, self.evaluate(trackable_state.read()))
  
      ckpt_path = os.path.join(self.get_temp_dir(), "ckpt")
      checkpoint.Checkpoint(a=saveable_state, b=trackable_state).write(
          ckpt_path
      )
  
      status = checkpoint.Checkpoint(
          b=saveable_state, a=trackable_state
      ).read(ckpt_path)
      status.assert_consumed()
  
      self.assertEqual(10, self.evaluate(saveable_state.read()))
      self.assertEqual(5, self.evaluate(trackable_state.read()))
  
      # Test that the converted SaveableState is compatible with the checkpoint
      # saved above.
      to_convert = SaveableState(0.0)
  
      converted_saveable_state = _create_converted_trackable(to_convert)
  
      checkpoint.Checkpoint(a=converted_saveable_state).read(
          ckpt_path
      ).assert_existing_objects_matched().expect_partial()
      self.assertEqual(5, self.evaluate(to_convert.read()))
  
      checkpoint.Checkpoint(b=converted_saveable_state).read(
          ckpt_path
      ).assert_existing_objects_matched().expect_partial()
      self.assertEqual(10, self.evaluate(to_convert.read()))
  
imports: import os
  from tensorflow.python.checkpoint import checkpoint
  from tensorflow.python.eager import context
  from tensorflow.python.eager import test
  from tensorflow.python.framework import dtypes
  from tensorflow.python.ops import gen_resource_variable_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.trackable import base
  from tensorflow.python.trackable import resource
  from tensorflow.python.training.saving import saveable_object
  from tensorflow.python.training.saving import saveable_object_util
label_desc: Use image node_id 1 for calling the SaveableCompatibilityEndToEndTest obj's underlying member method code with example usage: obj.test_checkpoint_comparison() without return types