Experimental context manager for use when defining a custom summary op.
@tf_contextlib.contextmanager tf.compat.v2.summary.experimental.summary_scope( name, default_name='summary', values=None )
This behaves similarly to
tf.name_scope, except that it returns a generated summary tag in addition to the scope name. The tag is structurally similar to the scope name - derived from the user-provided name, prefixed with enclosing name scopes if any - but we relax the constraint that it be uniquified, as well as the character set limitation (so the user-provided name can contain characters not legal for scope names; in the scope name these are removed).
This makes the summary tag more predictable and consistent for the user.
For example, to define a new summary op called
def my_op(name, my_value, step): with tf.summary.summary_scope(name, "MyOp", [my_value]) as (tag, scope): my_value = tf.convert_to_tensor(my_value) return tf.summary.write(tag, my_value, step=step)
| ||string name for the summary.|
| ||Optional; if provided, used as default name of the summary.|
| || Optional; passed as |
(tag, scope) as described above.
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.