| 27 | |
| 28 | |
| 29 | class InferencerToHook(tf.train.SessionRunHook): |
| 30 | def __init__(self, inf, fetches): |
| 31 | self._inf = inf |
| 32 | self._fetches = fetches |
| 33 | |
| 34 | def before_run(self, _): |
| 35 | return tf.train.SessionRunArgs(fetches=self._fetches) |
| 36 | |
| 37 | def after_run(self, _, run_values): |
| 38 | self._inf.on_fetches(run_values.results) |
| 39 | |
| 40 | |
| 41 | @contextmanager |
no outgoing calls
no test coverage detected
searching dependent graphs…