diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-08-08 16:12:36 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-08-08 16:17:08 -0700 |
commit | 4c60c96257bfd54a036d15af979e90fc0b4e400d (patch) | |
tree | d55d5220e715eacf71e9b79ba7737caa5727e986 /tensorflow/python/summary | |
parent | de5034aee81859ab8f6c1d910d69c7c198cf4d04 (diff) |
Make plugin_data an optional field of SummaryMetadata
Every summary op writes data for a single plugin to process. Hence, each SummaryMetadata proto should have a single PluginData optional field (instead of a repeated one). This removes much complexity from TensorBoard logic that loops over the plugin data. It also simplifies the SQL schema - it can now enforce a one-to-one relationship between summary op and plugin.
PiperOrigin-RevId: 164659570
Diffstat (limited to 'tensorflow/python/summary')
-rw-r--r-- | tensorflow/python/summary/text_summary.py | 4 | ||||
-rw-r--r-- | tensorflow/python/summary/writer/writer_test.py | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/tensorflow/python/summary/text_summary.py b/tensorflow/python/summary/text_summary.py index 0282554a6f..f0788399ff 100644 --- a/tensorflow/python/summary/text_summary.py +++ b/tensorflow/python/summary/text_summary.py @@ -70,8 +70,8 @@ def text_summary(name, tensor, collections=None): summary_metadata = summary_pb2.SummaryMetadata() text_plugin_data = _TextPluginData() data_dict = text_plugin_data._asdict() # pylint: disable=protected-access - summary_metadata.plugin_data.add( - plugin_name=PLUGIN_NAME, content=json.dumps(data_dict)) + summary_metadata.plugin_data.plugin_name = PLUGIN_NAME + summary_metadata.plugin_data.content = json.dumps(data_dict) t_summary = tensor_summary( name=name, tensor=tensor, diff --git a/tensorflow/python/summary/writer/writer_test.py b/tensorflow/python/summary/writer/writer_test.py index 3d27b11cb9..56629eb916 100644 --- a/tensorflow/python/summary/writer/writer_test.py +++ b/tensorflow/python/summary/writer/writer_test.py @@ -326,10 +326,12 @@ class SummaryWriterTestCase(test.TestCase): # We add 2 summaries with the same tags. They both have metadata. The writer # should strip the metadata from the second one. value = summary_pb2.Summary.Value(tag="foo", simple_value=10.0) - value.metadata.plugin_data.add(plugin_name="bar", content="... content ...") + value.metadata.plugin_data.plugin_name = "bar" + value.metadata.plugin_data.content = "... content ..." sw.add_summary(summary_pb2.Summary(value=[value]), 10) value = summary_pb2.Summary.Value(tag="foo", simple_value=10.0) - value.metadata.plugin_data.add(plugin_name="bar", content="... content ...") + value.metadata.plugin_data.plugin_name = "bar" + value.metadata.plugin_data.content = "... content ..." sw.add_summary(summary_pb2.Summary(value=[value]), 10) sw.close() |