Returns the underlying summary writer for a specific subdirectory. Args: relative_path: The current path in which to write summaries, relative to the summary directory. By default it is empty, which corresponds to the root directory.
(self, relative_path="")
| 45 | self._global_step = global_step |
| 46 | |
| 47 | def summary_writer(self, relative_path=""): |
| 48 | """Returns the underlying summary writer for a specific subdirectory. |
| 49 | |
| 50 | Args: |
| 51 | relative_path: The current path in which to write summaries, relative to |
| 52 | the summary directory. By default it is empty, which corresponds to the |
| 53 | root directory. |
| 54 | """ |
| 55 | if self._summary_writers and relative_path in self._summary_writers: |
| 56 | return self._summary_writers[relative_path] |
| 57 | if self._enabled: |
| 58 | self._summary_writers[relative_path] = tf.summary.create_file_writer( |
| 59 | os.path.join(self._summary_dir, relative_path)) |
| 60 | else: |
| 61 | self._summary_writers[relative_path] = tf.summary.create_noop_writer() |
| 62 | return self._summary_writers[relative_path] |
| 63 | |
| 64 | def flush(self): |
| 65 | """Flushes the underlying summary writers.""" |
no test coverage detected