code: def test_has_serialize_to_tensor(self):
      class ReturnsTrue(base.Trackable):
          def _serialize_to_tensors(self):
              return {}
  
      class ReturnsFalse(base.Trackable):
          pass
  
      class SubclassReturnsFalse(ReturnsTrue):
          def _gather_saveables_for_checkpoint(self):
              return {}
  
      self.assertTrue(
          saveable_object_util.trackable_has_serialize_to_tensor(
              ReturnsTrue()
          )
      )
      self.assertFalse(
          saveable_object_util.trackable_has_serialize_to_tensor(
              ReturnsFalse()
          )
      )
  
      # This should return False, because even though its parent class has
      # `_serialize_to_tensors`, the class itself defines
      # `_gather_saveables_for_checkpoint`.
      self.assertFalse(
          saveable_object_util.trackable_has_serialize_to_tensor(
              SubclassReturnsFalse()
          )
      )
  
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 HasSerializeToTensorTest obj's underlying member method code with example usage: obj.test_has_serialize_to_tensor() and returns: dict, dict