code: def hook_outputs(modules, detach=True, cpu=False, grad=False):
      "Return `Hooks` that store activations of all `modules` in `self.stored`"
      return Hooks(
          modules,
          _hook_inner,
          detach=detach,
          cpu=cpu,
          is_forward=not grad,
      )
  
imports: from __future__ import annotations
  from ..basics import *
label_desc: Use image node_id 3 for calling a global function with example usage: hook_outputs(modules, detach, cpu, grad) and returns: Hooks