code: def __init__(
      self,
      model: "nn.Module",
      name: str = "model",
      *,
      add_forward_hooks=True,
      add_backward_hooks=False,
  ):
      self.model = model
      for n, module in model.named_modules():
          module: "nn.Module"
          if n == "":
              n = name
          if add_forward_hooks:
              forward_hook = ForwardHook(n, self._add_forward_tensor)
              module.register_forward_hook(forward_hook)
  
          if add_backward_hooks:
              backward_hook = ForwardHook(n, self._add_backward_tensor)
              module.register_full_backward_hook(backward_hook)
  
      self._forward_output = {}
      self._forward_input = {}
  
      self._backward_output = {}
      self._backward_input = {}
  
      self._parameters = {}
      for k, v in model.named_parameters():
          self._parameters[k] = v
  
imports: from typing import Callable, Dict, List, TYPE_CHECKING
  from labml.internal.util.strings import is_pattern_match
label_desc: Use image node_id 1 to create a new ModelProbe object  with example: obj = ModelProbe(model, name)