class_docstr: A chainer RNNLM
  
  :param int n_vocab: The size of the vocabulary
  :param int n_layers: The number of layers to create
  :param int n_units: The number of units per layer
  :param str type: The RNN type
class_docstr_tok: ["A","chainer","RNNLM",":","param","int","n_vocab",":","The","size","of","the","vocabulary",":","param","int","n_layers",":","The","number","of","layers","to","create",":","param","int","n_units",":","The","number","of","units","per","layer",":","param","str","type",":","The","RNN","type"]
code: def __init__(self, n_vocab, n_layers, n_units, typ="lstm"):
      super(RNNLM, self).__init__()
      with self.init_scope():
          self.embed = DL.EmbedID(n_vocab, n_units)
          self.rnn = (
              chainer.ChainList(
                  *[
                      L.StatelessLSTM(n_units, n_units)
                      for _ in range(n_layers)
                  ]
              )
              if typ == "lstm"
              else chainer.ChainList(
                  *[
                      L.StatelessGRU(n_units, n_units)
                      for _ in range(n_layers)
                  ]
              )
          )
          self.lo = L.Linear(n_units, n_vocab)
  
      for param in self.params():
          param.data[...] = np.random.uniform(
              -0.1, 0.1, param.data.shape
          )
      self.n_layers = n_layers
      self.n_units = n_units
      self.typ = typ
  
imports: import copy
  import json
  import logging
  import chainer
  import chainer.functions
  import chainer.links
  import numpy
  from chainer import link, reporter, training
  from chainer.dataset import convert
  from chainer.functions.loss import softmax_cross_entropy
  from chainer.training import extensions
  import espnet.nets.chainer_backend.deterministic_embed_id
  from espnet.lm.lm_utils import MakeSymlinkToBestModel, ParallelSentenceIterator, compute_perplexity, count_tokens, read_tokens
  from espnet.nets.lm_interface import LMInterface
  from espnet.optimizer.factory import dynamic_import_optimizer
  from espnet.scheduler.chainer import ChainerScheduler
  from espnet.scheduler.scheduler import dynamic_import_scheduler
  from espnet.utils.deterministic_utils import set_deterministic_chainer
  from espnet.utils.training.evaluator import BaseEvaluator
  from espnet.utils.training.iterators import ShufflingEnabler
  from espnet.utils.training.tensorboard_logger import TensorboardLogger
  from espnet.utils.training.train_utils import check_early_stop, set_early_stop
label_desc: Use image node_id 1 to create a new RNNLM object from inherited base classes: chainer with example: obj = RNNLM(n_vocab, n_layers, n_units, typ)