def op(name,
guest,
display_name=None,
description=None,
collections=None):
"""Create a TensorFlow summary op to greet the given guest.
Arguments:
name: A name for this summary operation.
guest: A rank-0 string `Tensor`.
display_name: If set, will be used as the display name
in TensorBoard. Defaults to `name`.
description: A longform readable description of the summary data.
Markdown is supported.
collections: Which TensorFlow graph collections to add the summary
op to. Defaults to `['summaries']`. Can usually be ignored.
"""
# The `name` argument is used to generate the summary op node name.
# That node name will also involve the TensorFlow name scope.
# By having the display_name default to the name argument, we make
# the TensorBoard display clearer.
if display_name is None:
display_name = name
# We could put additional metadata other than the PLUGIN_NAME,
# but we don't need any metadata for this simple example.
summary_metadata = tf.SummaryMetadata(
display_name=display_name,
summary_description=description,
plugin_data=tf.SummaryMetadata.PluginData(
plugin_name=PLUGIN_NAME,
content=''))
message = tf.string_join(['Hello, ', guest, '!'])
# Return a summary op that is properly configured.
return tf.summary.tensor_summary(
name,
message,
summary_metadata=summary_metadata,
collections=collections)
greeter_summary.py 文件源码
python
阅读 33
收藏 0
点赞 0
评论 0
评论列表
文章目录