pyanomaly/core/engine/abstract/abstract_engine.py
def _register_hooks(self, hooks):
        """Register hooks to the trainer.
        The hooks are executed in the order they are registered.
        Args:
            hooks (list[Optional[HookBase]]): list of hooks
        """
        hooks = [h for h in hooks if h is not None]
        for h in hooks:
            assert isinstance(h, HookBase)
            # To avoid circular reference, hooks and trainer cannot own each other.
            # This normally does not matter, but will cause memory leak if the
            # involved objects contain __del__:
            # See http://engineering.hearsaysocial.com/2013/06/16/circular-references-in-python/
            h.engine = weakref.proxy(self)
        self._hooks.extend(hooks)
Register hooks to the trainer.
        The hooks are executed in the order they are registered.
        Args:
            hooks (list[Optional[HookBase]]): list of hooks
        
Register hooks to the trainer.
The hooks are executed in the order they are registered.
Register hooks to the trainer . The hooks are executed in the order they are registered .
def _register_hooks(self, hooks):
        hooks = [h for h in hooks if h is not None]
        for h in hooks:
            assert isinstance(h, HookBase)
            h.engine = weakref.proxy(self)
        self._hooks.extend(hooks)
def _register_hooks ( self , hooks ) : hooks = [ h for h in hooks if h is not None ] for h in hooks : assert isinstance ( h , HookBase ) h . engine = weakref . proxy ( self ) self . _hooks . extend ( hooks )
Register hooks to the trainer.
Register hooks to the trainer .
"""Register hooks to the trainer.
        The hooks are executed in the order they are registered.
        Args:
            hooks (list[Optional[HookBase]]): list of hooks
        """ # To avoid circular reference, hooks and trainer cannot own each other.
 # This normally does not matter, but will cause memory leak if the
 # involved objects contain __del__:
 # See http://engineering.hearsaysocial.com/2013/06/16/circular-references-in-python/

self
hooks
list of hooks
list of hooks