Hooks are less powerful than callbacks so the conversion is incomplete. It only converts the ``before_run/after_run`` calls. This is only for internal implementation of ``before_run/after_run`` callbacks. You shouldn't need to use this.
| 15 | |
| 16 | |
| 17 | class CallbackToHook(tfv1.train.SessionRunHook): |
| 18 | """ |
| 19 | Hooks are less powerful than callbacks so the conversion is incomplete. |
| 20 | It only converts the ``before_run/after_run`` calls. |
| 21 | |
| 22 | This is only for internal implementation of |
| 23 | ``before_run/after_run`` callbacks. |
| 24 | You shouldn't need to use this. |
| 25 | """ |
| 26 | |
| 27 | def __init__(self, cb): |
| 28 | self._cb = cb |
| 29 | |
| 30 | @HIDE_DOC |
| 31 | def before_run(self, ctx): |
| 32 | return self._cb.before_run(ctx) |
| 33 | |
| 34 | @HIDE_DOC |
| 35 | def after_run(self, ctx, vals): |
| 36 | self._cb.after_run(ctx, vals) |
| 37 | |
| 38 | |
| 39 | class HookToCallback(Callback): |
no outgoing calls
no test coverage detected