class_docstr: ## Auto regressive model
class_docstr_tok: ["#","#","Auto","regressive","model"]
code: def __init__(
      self,
      n_vocab: int,
      d_model: int,
      transformer: CompressiveTransformer,
  ):
      super().__init__()
      # Token embedding module
      self.src_embed = nn.Embedding(n_vocab, d_model)
      # Transformer
      self.transformer = transformer
      # Final layer
      self.generator = nn.Linear(d_model, n_vocab)
      # Masks
      self.mask_x = None
      self.mask_mem = None
  
imports: from typing import List, Tuple, NamedTuple
  import torch
  import torch.nn
  from labml import experiment, tracker, monit, logger
  from labml.configs import option
  from labml.logger import Text
  from labml_helpers.metrics.simple_state import SimpleStateModule
  from labml_helpers.module import Module
  from labml_helpers.train_valid import BatchIndex, hook_model_outputs
  from labml_nn.experiments.nlp_autoregression import NLPAutoRegressionConfigs
  from labml_nn.transformers.compressive import CompressiveTransformer, AttentionReconstructionLoss, CompressiveTransformerLayer, Conv1dCompression
label_desc: Use image node_id 1 to create a new AutoregressiveModel object from inherited base classes: Module with example: obj = AutoregressiveModel(n_vocab, d_model, transformer)