Writes entire RunMetadata summary. A RunMetadata can contain DeviceStats, partition graphs, and function graphs. Please refer to the proto for definition of each field. Args: name: A name for this summary. The summary tag used for TensorBoard will be this name prefixed by any activ
(name, data, step=None)
| 989 | |
| 990 | |
| 991 | def run_metadata(name, data, step=None): |
| 992 | """Writes entire RunMetadata summary. |
| 993 | |
| 994 | A RunMetadata can contain DeviceStats, partition graphs, and function graphs. |
| 995 | Please refer to the proto for definition of each field. |
| 996 | |
| 997 | Args: |
| 998 | name: A name for this summary. The summary tag used for TensorBoard will be |
| 999 | this name prefixed by any active name scopes. |
| 1000 | data: A RunMetadata proto to write. |
| 1001 | step: Explicit `int64`-castable monotonic step value for this summary. If |
| 1002 | omitted, this defaults to `tf.summary.experimental.get_step()`, which must |
| 1003 | not be None. |
| 1004 | |
| 1005 | Returns: |
| 1006 | True on success, or false if no summary was written because no default |
| 1007 | summary writer was available. |
| 1008 | |
| 1009 | Raises: |
| 1010 | ValueError: if a default writer exists, but no step was provided and |
| 1011 | `tf.summary.experimental.get_step()` is None. |
| 1012 | """ |
| 1013 | summary_metadata = summary_pb2.SummaryMetadata() |
| 1014 | # Hard coding a plugin name. Please refer to go/tb-plugin-name-hardcode for |
| 1015 | # the rationale. |
| 1016 | summary_metadata.plugin_data.plugin_name = "graph_run_metadata" |
| 1017 | # version number = 1 |
| 1018 | summary_metadata.plugin_data.content = b"1" |
| 1019 | |
| 1020 | with summary_scope(name, |
| 1021 | "graph_run_metadata_summary", |
| 1022 | [data, step]) as (tag, _): |
| 1023 | with ops.device("cpu:0"): |
| 1024 | tensor = constant_op.constant(data.SerializeToString(), |
| 1025 | dtype=dtypes.string) |
| 1026 | return write( |
| 1027 | tag=tag, |
| 1028 | tensor=tensor, |
| 1029 | step=step, |
| 1030 | metadata=summary_metadata) |
| 1031 | |
| 1032 | |
| 1033 | def run_metadata_graphs(name, data, step=None): |
no test coverage detected