code: def hook_fn(self, module:nn.Module, input:Tensors, output:Tensors):
          "Applies `hook_func` to `module`, `input`, `output`."
          if self.detach:
              input  = (o.detach() for o in input ) if is_listy(input ) else input.detach()
              output = (o.detach() for o in output) if is_listy(output) else output.detach()
          self.stored = self.hook_func(module, input, outputf hook_fn(self, module:nn.Module, input:Tensors, output:Tensors):
          "Applies `hook_func` to `module`, `input`, `output`."
          if self.detach:
              input  = (o.detach() for o in input ) if is_listy(input ) else input.detach()
              output = (o.detach() for o in output) if is_listy(output) else output.detach()
          self.stored = self.hook_func(module, input, output)
docs: Applies `hook_func` to `module`, `input`, `output`.