code: def sample(self, input, temperature=1.0, hidden=None):
      hidden = self.module_.init_hidden(1) if hidden is None else hidden
      output, hidden = self.module_(input, hidden)
      probas = output.squeeze().data.div(temperature).exp()
      sample = torch.multinomial(probas, 1)[-1]
      if probas.dim() > 1:
          sample = sample[0]
      return sample, self.repackage_hidden(hidden)
  
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 8 for calling the Net obj's underlying member method code with example usage: obj.sample(input, temperature, hidden) and returns: sample,  self