diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-11-21 12:24:12 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-11-21 12:27:46 -0800 |
commit | 6c7bd707ce26cc89d542bbb326882026a613748c (patch) | |
tree | 71672568b60e68f5aa5c1fa5ec5f1014fdd2d074 /tensorflow/contrib/saved_model | |
parent | b5dcb0161942c467be6cba19aa0ee05aef742d2e (diff) |
Add tpu saved model tags. No cpu tag is added because cpu is assumed to be the implicit device.
PiperOrigin-RevId: 176544698
Diffstat (limited to 'tensorflow/contrib/saved_model')
-rw-r--r-- | tensorflow/contrib/saved_model/python/saved_model/reader_test.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tensorflow/contrib/saved_model/python/saved_model/reader_test.py b/tensorflow/contrib/saved_model/python/saved_model/reader_test.py index a8331cbc8f..d10ec9cf0c 100644 --- a/tensorflow/contrib/saved_model/python/saved_model/reader_test.py +++ b/tensorflow/contrib/saved_model/python/saved_model/reader_test.py @@ -88,6 +88,13 @@ class ReaderTest(test.TestCase): # Graph that updates the single variable. SavedModel is invoked: # - to add the model (weights are not updated). + # - multiple predefined tags for serving on TPU. + with self.test_session(graph=ops.Graph()) as sess: + self._init_and_validate_variable(sess, "v", 44) + builder.add_meta_graph([tag_constants.SERVING, tag_constants.TPU]) + + # Graph that updates the single variable. SavedModel is invoked: + # - to add the model (weights are not updated). # - multiple custom tags. with self.test_session(graph=ops.Graph()) as sess: self._init_and_validate_variable(sess, "v", 45) @@ -97,7 +104,8 @@ class ReaderTest(test.TestCase): builder.save() actual_tags = reader.get_saved_model_tag_sets(saved_model_dir) - expected_tags = [["train"], ["serve"], ["serve", "gpu"], ["foo", "bar"]] + expected_tags = [["train"], ["serve"], ["serve", "gpu"], ["serve", "tpu"], + ["foo", "bar"]] self.assertEqual(expected_tags, actual_tags) |