From c02e3f9af900d5d9aa536d19c18f6e8a036158ee Mon Sep 17 00:00:00 2001 From: Allen Lavoie Date: Thu, 23 May 2019 15:13:15 -0700 Subject: [PATCH] Minor tweaks to tf.saved_model.save's docstring Subclass Module instead of Checkpoint, remove the "this may change" paragraph. PiperOrigin-RevId: 249724699 --- tensorflow/python/saved_model/save.py | 13 +------------ tensorflow/python/saved_model/save_test.py | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/tensorflow/python/saved_model/save.py b/tensorflow/python/saved_model/save.py index 602e2e305eb..f73276ff407 100644 --- a/tensorflow/python/saved_model/save.py +++ b/tensorflow/python/saved_model/save.py @@ -630,7 +630,7 @@ def save(obj, export_dir, signatures=None): Example usage: ```python - class Adder(tf.train.Checkpoint): + class Adder(tf.Module): @tf.function(input_signature=[tf.TensorSpec(shape=None, dtype=tf.float32)]) def add(self, x): @@ -747,17 +747,6 @@ def save(obj, export_dir, signatures=None): handled automatically, such as when the exported model contains operations which the consumer does not have definitions for. - The current implementation of `tf.saved_model.save` targets serving use-cases, - but omits information which will be necessary for the planned future - implementation of `tf.saved_model.load`. Exported models using the current - `save` implementation, and other existing SavedModels, will not be compatible - with `tf.saved_model.load` when it is implemented. Further, `save` will in the - future attempt to export `@tf.function`-decorated methods which it does not - currently inspect, so some objects which are exportable today will raise - exceptions on export in the future (e.g. due to complex/non-serializable - default arguments). Such backwards-incompatible API changes are expected only - prior to the TensorFlow 2.0 release. - Args: obj: A trackable object to export. export_dir: A directory in which to write the SavedModel. diff --git a/tensorflow/python/saved_model/save_test.py b/tensorflow/python/saved_model/save_test.py index a2ee86f6a9a..b412fa6f145 100644 --- a/tensorflow/python/saved_model/save_test.py +++ b/tensorflow/python/saved_model/save_test.py @@ -262,7 +262,7 @@ class SaveTest(test.TestCase): def test_docstring(self): - class Adder(util.Checkpoint): + class Adder(module.Module): @def_function.function(input_signature=[tensor_spec.TensorSpec( shape=None, dtype=dtypes.float32)])