Indicate that a summary was computed. Args: sess: A `Session` object. summary: A Summary proto, or a string holding a serialized summary proto. global_step: Int. global step this summary is associated with. If `None`, it will try to fetch the current step. Raises:
(self, sess, summary, global_step=None)
| 883 | self._coord.wait_for_stop() |
| 884 | |
| 885 | def summary_computed(self, sess, summary, global_step=None): |
| 886 | """Indicate that a summary was computed. |
| 887 | |
| 888 | Args: |
| 889 | sess: A `Session` object. |
| 890 | summary: A Summary proto, or a string holding a serialized summary proto. |
| 891 | global_step: Int. global step this summary is associated with. If `None`, |
| 892 | it will try to fetch the current step. |
| 893 | |
| 894 | Raises: |
| 895 | TypeError: if 'summary' is not a Summary proto or a string. |
| 896 | RuntimeError: if the Supervisor was created without a `logdir`. |
| 897 | """ |
| 898 | if not self._summary_writer: |
| 899 | raise RuntimeError("Writing a summary requires a summary writer.") |
| 900 | if global_step is None and self.global_step is not None: |
| 901 | global_step = training_util.global_step(sess, self.global_step) |
| 902 | self._summary_writer.add_summary(summary, global_step) |
| 903 | |
| 904 | def _default_global_step_tensor(self): |
| 905 | """Returns the global_step from the default graph. |