code: def _hook(self, _, inputs, output):
      layer_output = inputs if self.layer_save_input else output
      self.latents = apply_tuple_or_single(self.detach_fn, layer_output)
  
file_path: vit-pytorch/vit_pytorch/extractor.py
imports: import torch
  from torch import nn
label_desc: Use image node_id 2 for calling the Extractor obj's underlying member method code with example usage: obj._hook(_, inputs, output) without return types