| 1554 | """Wrapper around a Session that logs errors in run().""" |
| 1555 | |
| 1556 | def run(self, *args, **kwargs): |
| 1557 | try: |
| 1558 | return super(ErrorLoggingSession, self).run(*args, **kwargs) |
| 1559 | except Exception as e: # pylint: disable=broad-except |
| 1560 | # Note: disable the logging for OutOfRangeError, which makes the output |
| 1561 | # of tf.data tests hard to read, because OutOfRangeError is used as the |
| 1562 | # signal completion |
| 1563 | if not isinstance(e, errors.OutOfRangeError): |
| 1564 | logging.error(str(e)) |
| 1565 | raise |
| 1566 | |
| 1567 | |
| 1568 | def disable_cudnn_autotune(func): |