returnn.frontend.hooks
¶
Hooks logic
- returnn.frontend.hooks.setup_post_hook_on_method(obj: Any, attr: str, hook: Callable[[T, Tuple[Any, ...], Dict[str, Any], Any], Any | None], *, prepend: bool = False) RemovableHandle [source]¶
- Parameters:
obj – e.g. module
attr – attribute name to get the method, via
getattr(obj, attr)
hook
prepend – if there are multiple hooks, this will be registered in front of all, otherwise at the end