MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / scalar

Function scalar

tensorflow/python/ops/summary_ops_v2.py:757–786  ·  view source on GitHub ↗

Writes a scalar summary if possible. Unlike `tf.contrib.summary.generic` this op may change the dtype depending on the writer, for both practical and efficiency concerns. Args: name: An arbitrary name for this summary. tensor: A `tf.Tensor` Must be one of the following types: `

(name, tensor, family=None, step=None)

Source from the content-addressed store, hash-verified

755
756
757def scalar(name, tensor, family=None, step=None):
758 """Writes a scalar summary if possible.
759
760 Unlike `tf.contrib.summary.generic` this op may change the dtype
761 depending on the writer, for both practical and efficiency concerns.
762
763 Args:
764 name: An arbitrary name for this summary.
765 tensor: A `tf.Tensor` Must be one of the following types:
766 `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`,
767 `int8`, `uint16`, `half`, `uint32`, `uint64`.
768 family: Optional, the summary's family.
769 step: The `int64` monotonic step variable, which defaults
770 to `tf.compat.v1.train.get_global_step`.
771
772 Returns:
773 The created `tf.Operation` or a `tf.no_op` if summary writing has
774 not been enabled for this context.
775 """
776
777 def function(tag, scope):
778 # Note the identity to move the tensor to the CPU.
779 return gen_summary_ops.write_scalar_summary(
780 context.context().summary_writer._resource, # pylint: disable=protected-access
781 _choose_step(step),
782 tag,
783 array_ops.identity(tensor),
784 name=scope)
785
786 return summary_writer_function(name, tensor, function, family=family)
787
788
789def histogram(name, tensor, family=None, step=None):

Callers

nothing calls this directly

Calls 1

summary_writer_functionFunction · 0.85

Tested by

no test coverage detected