code: def repackage_hidden(h):
      
      if isinstance(h, torch.Tensor):
          return h.detach()
      else:
          return tuple(repackage_hidden(v) for v in h)
docs: Wraps hidden states in new Tensors, to detach them from their history.