Enters a context where all summary ops are skipped. Summaries are not yet supported in xla.compile(). So we provide this context manager that can skip creating summary ops. This is a temporary workaround due to XLA not supporting summary ops. Yields: None.
()
| 518 | |
| 519 | @contextlib.contextmanager |
| 520 | def _disable_summary_context(): |
| 521 | """Enters a context where all summary ops are skipped. |
| 522 | |
| 523 | Summaries are not yet supported in xla.compile(). So we provide this context |
| 524 | manager that can skip creating summary ops. This is a temporary workaround due |
| 525 | to XLA not supporting summary ops. |
| 526 | |
| 527 | Yields: |
| 528 | None. |
| 529 | """ |
| 530 | original_skip_summary_func = summary_op_util.skip_summary |
| 531 | summary_op_util.skip_summary = lambda: True |
| 532 | |
| 533 | try: |
| 534 | yield |
| 535 | finally: |
| 536 | summary_op_util.skip_summary = original_skip_summary_func |
| 537 | |
| 538 | |
| 539 | class _CapturedObject(object): |