def __call__(self, *args):
        """Calls forward. Only accepts positional arguments."""
        for hook in self._forward_pre_hooks.values():
            hook(self, args)

        out = self.forward(*args)

        for hook in self._forward_hooks.values():
            hook(self, args, out)

        return out
def __call__ ( self , * args ) : for hook in self . _forward_pre_hooks . values ( ) : hook ( self , args ) out = self . forward ( * args ) for hook in self . _forward_hooks . values ( ) : hook ( self , args , out ) return out
Calls forward. Only accepts positional arguments.