class_docstr: `LMLSTM` implements a word-level language model that uses LSTMs to
  represent the document.
class_docstr_tok: ["`","LMLSTM","`","implements","a","word-level","language","model","that","uses","LSTMs","to","represent","the","document","."]
docstr: Initialize the hidden states of the LSTM if the language model is
  stateful.
  
  Args:
      bsz (int): Batch size.
  
  Returns:
      Tuple[torch.Tensor, torch.Tensor]: Initialized hidden state and
      cell state of the LSTM.
docstr_tok: ["Initialize","the","hidden","states","of","the","LSTM","if","the","language","model","is","stateful",".","Args",":","bsz","(","int",")",":","Batch","size",".","Returns",":","Tuple","[","torch.Tensor",",","torch.Tensor","]",":","Initialized","hidden","state","and","cell","state","of","the","LSTM","."]
code: def init_hidden(self, bsz: int) -> Tuple[torch.Tensor, torch.Tensor]:
      """
      Initialize the hidden states of the LSTM if the language model is
      stateful.
  
      Args:
          bsz (int): Batch size.
  
      Returns:
          Tuple[torch.Tensor, torch.Tensor]: Initialized hidden state and
          cell state of the LSTM.
      """
      weight = next(self.parameters())
      num_layers = self.representation.lstm.num_layers
      rnn_hidden_dim = self.representation.representation_dim
      return (
          weight.new_zeros(bsz, num_layers, rnn_hidden_dim),
          weight.new_zeros(bsz, num_layers, rnn_hidden_dim),
      )
  
imports: from typing import Dict, List, Optional, Tuple, Union
  import torch
  from pytext.config import ConfigBase
  from pytext.config.module_config import ExporterType
  from pytext.data import CommonMetadata
  from pytext.data.tensorizers import Tensorizer, TokenTensorizer
  from pytext.exporters.custom_exporters import get_exporter
  from pytext.exporters.exporter import ModelExporter
  from pytext.models.decoders import DecoderBase
  from pytext.models.decoders.mlp_decoder import MLPDecoder
  from pytext.models.embeddings import EmbeddingBase
  from pytext.models.embeddings.word_embedding import WordEmbedding
  from pytext.models.model import BaseModel, Model
  from pytext.models.module import create_module
  from pytext.models.output_layers import OutputLayerBase
  from pytext.models.output_layers.lm_output_layer import LMOutputLayer
  from pytext.models.representations.bilstm import BiLSTM
  from pytext.models.representations.deepcnn import DeepCNNRepresentation
  from pytext.models.representations.representation_base import RepresentationBase
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 13 for calling the LMLSTM obj's underlying member method code with example usage: obj.init_hidden(bsz) and returns: weight,  weight