code: def repackage_hidden(self, h):
          
          if isinstance(h, Variable):
              return torch.tensor(h.data, device=h.device)
          else:
              return tuple(self.repackage_hidden(v) for v in h)
docs: Wraps hidden states in new Variables, to detach them from their history.