From ac6248d02be521dddddc1be1e2cd70e75d7e0c4b Mon Sep 17 00:00:00 2001 From: William Chargin Date: Wed, 22 Jan 2020 16:12:41 -0800 Subject: [PATCH] Add data class metadata to `Summary` protos Summary metadata protos may now declare their generic data class, one of scalar, tensor, or blob sequence. This affords ingestion of summaries on disk into storage layers that implement the TensorBoard `DataProvider` API. This is a subset of a change to TensorBoard: PiperOrigin-RevId: 291053636 Change-Id: I53c74326b04d02850bcfc762c72f5b133a440daf --- tensorflow/core/framework/summary.proto | 24 +++++++++++++++++++ .../v1/tensorflow.-summary-metadata.pbtxt | 7 ++++++ 2 files changed, 31 insertions(+) diff --git a/tensorflow/core/framework/summary.proto b/tensorflow/core/framework/summary.proto index 532e4fcd87b..b6e4aaf6331 100644 --- a/tensorflow/core/framework/summary.proto +++ b/tensorflow/core/framework/summary.proto @@ -53,8 +53,32 @@ message SummaryMetadata { // Longform readable description of the summary sequence. Markdown supported. string summary_description = 3; + + // Class of data stored in this time series. Required for compatibility with + // TensorBoard's generic data facilities (`DataProvider`, et al.). This value + // imposes constraints on the dtype and shape of the corresponding tensor + // values. See `DataClass` docs for details. + DataClass data_class = 4; }; +enum DataClass { + // Unknown data class, used (implicitly) for legacy data. Will not be + // processed by data ingestion pipelines. + DATA_CLASS_UNKNOWN = 0; + // Scalar time series. Each `Value` for the corresponding tag must have + // `tensor` set to a rank-0 tensor of floating-point dtype, which will be + // converted to float64. + DATA_CLASS_SCALAR = 1; + // Tensor time series. Each `Value` for the corresponding tag must have + // `tensor` set. The tensor value is arbitrary, but should be small to + // accommodate direct storage in database backends: an upper bound of a few + // kilobytes is a reasonable rule of thumb. + DATA_CLASS_TENSOR = 2; + // Blob sequence time series. Each `Value` for the corresponding tag must + // have `tensor` set to a rank-1 tensor of bytestring dtype. + DATA_CLASS_BLOB_SEQUENCE = 3; +} + // A Summary is a set of named values to be displayed by the // visualizer. // diff --git a/tensorflow/tools/api/golden/v1/tensorflow.-summary-metadata.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.-summary-metadata.pbtxt index c02575b9626..dd655b1a75d 100644 --- a/tensorflow/tools/api/golden/v1/tensorflow.-summary-metadata.pbtxt +++ b/tensorflow/tools/api/golden/v1/tensorflow.-summary-metadata.pbtxt @@ -21,6 +21,13 @@ tf_proto { label: LABEL_OPTIONAL type: TYPE_STRING } + field { + name: "data_class" + number: 4 + label: LABEL_OPTIONAL + type: TYPE_ENUM + type_name: ".tensorflow.DataClass" + } nested_type { name: "PluginData" field {