MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / put_summary

Method put_summary

tensorpack/callbacks/monitor.py:140–161  ·  view source on GitHub ↗

Put a `tf.Summary`.

(self, summary)

Source from the content-addressed store, hash-verified

138 func(m)
139
140 def put_summary(self, summary):
141 """
142 Put a `tf.Summary`.
143 """
144 if isinstance(summary, six.binary_type):
145 summary = tf.Summary.FromString(summary)
146 assert isinstance(summary, tf.Summary), type(summary)
147
148 # TODO other types
149 for val in summary.value:
150 if val.WhichOneof('value') == 'simple_value':
151 val.tag = re.sub('tower[0-9]+/', '', val.tag) # TODO move to subclasses
152
153 # TODO This hack is still needed, seem to disappear only when
154 # compiled from source.
155 suffix = '-summary' # tensorflow#6150, tensorboard#59
156 if val.tag.endswith(suffix):
157 val.tag = val.tag[:-len(suffix)]
158
159 self._dispatch(lambda m: m.process_scalar(val.tag, val.simple_value))
160
161 self._dispatch(lambda m: m.process_summary(summary))
162
163 def put_scalar(self, name, val):
164 """

Callers 2

_triggerMethod · 0.80
_after_runMethod · 0.80

Calls 3

_dispatchMethod · 0.95
process_scalarMethod · 0.45
process_summaryMethod · 0.45

Tested by

no test coverage detected