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

Function generic

tensorflow/python/ops/summary_ops_v2.py:736–754  ·  view source on GitHub ↗

Writes a tensor summary if possible.

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

Source from the content-addressed store, hash-verified

734
735
736def generic(name, tensor, metadata=None, family=None, step=None):
737 """Writes a tensor summary if possible."""
738
739 def function(tag, scope):
740 if metadata is None:
741 serialized_metadata = constant_op.constant("")
742 elif hasattr(metadata, "SerializeToString"):
743 serialized_metadata = constant_op.constant(metadata.SerializeToString())
744 else:
745 serialized_metadata = metadata
746 # Note the identity to move the tensor to the CPU.
747 return gen_summary_ops.write_summary(
748 context.context().summary_writer._resource, # pylint: disable=protected-access
749 _choose_step(step),
750 array_ops.identity(tensor),
751 tag,
752 serialized_metadata,
753 name=scope)
754 return summary_writer_function(name, tensor, function, family=family)
755
756
757def scalar(name, tensor, family=None, step=None):

Callers

nothing calls this directly

Calls 1

summary_writer_functionFunction · 0.85

Tested by

no test coverage detected