code: def save(self, name: str, output):
      if isinstance(output, torch.Tensor):
          pytorch_utils.store_var(name, output)
      elif isinstance(output, tuple):
          for i, o in enumerate(output):
              self.save(f"{name}.{i}", o)
  
imports: from typing import Optional, Dict, List, Callable, Any
  import torch.optim
  import torch.optim
  import torch.utils.data
  import torch.utils.data
  from torch import nn
  import labml.utils.pytorch
  from labml import tracker, monit
  from labml.configs import option, meta_config
  from .device import DeviceConfigs
  from .metrics import StateModule
  from .training_loop import TrainingLoopConfigs
label_desc: Use image node_id 2 for calling the ForwardHook obj's underlying member method code with example usage: obj.save(name, output) without return types