docstr: Wraps hidden states in new Variables, to detach them from their history.
docstr_tok: ["Wraps","hidden","states","in","new","Variables",",","to","detach","them","from","their","history","."]
code: def repackage_hidden(self, h):
      """Wraps hidden states in new Variables, to detach them from their history."""
      if isinstance(h, Variable):
          return torch.tensor(h.data, device=h.device)
      else:
          return tuple(self.repackage_hidden(v) for v in h)
  
file_path: skorch/examples/word_language_model/net.py
imports: import skorch
  import numpy
  import torch
  from torch.autograd import Variable
  from sklearn.metrics import f1_score
label_desc: Use image node_id 2 for calling the Net obj's underlying member method code with example usage: obj.repackage_hidden(h) and returns: torch, tuple