parameters: (self,batch_size)
return_statement: return hiddens
docstring: helper function to initialize rnn hidden state
docstring_summary: helper function to initialize rnn hidden state
docstring_tokens: helper function to initialize rnn hidden state
function: def initHidden(self,batch_size):
          """
          helper function to initialize rnn hidden state
          """
          hiddens = []
  
          lstm = self.model_type=='lstm'
  
          if lstm:
              h0 = Variable(torch.zeros(batch_size, self.hidden_size))
              c0 = Variable(torch.zeros(batch_size, self.hidden_size))
              hiddens.append( (h0,c0) )
  
              h1 = Variable(torch.zeros(batch_size, self.hidden_size))
              c1 = Variable(torch.zeros(batch_size, self.hidden_size))
              hiddens.append( (h1,c1) )
          else:
              hiddens.append( Variable(torch.zeros(batch_size, self.hidden_size) ) )
              hiddens.append( Variable(torch.zeros(batch_size, self.hidden_size) ) )
  
          return hiddens
function_tokens: def initHidden ( self , batch_size ) : hiddens = [ ] lstm = self . model_type == 'lstm' if lstm : h0 = Variable ( torch . zeros ( batch_size , self . hidden_size ) ) c0 = Variable ( torch . zeros ( batch_size , self . hidden_size ) ) hiddens . append ( ( h0 , c0 ) ) h1 = Variable ( torch . zeros ( batch_size , self . hidden_size ) ) c1 = Variable ( torch . zeros ( batch_size , self . hidden_size ) ) hiddens . append ( ( h1 , c1 ) ) else : hiddens . append ( Variable ( torch . zeros ( batch_size , self . hidden_size ) ) ) hiddens . append ( Variable ( torch . zeros ( batch_size , self . hidden_size ) ) ) return hiddens