class_docstr: ## Auto-Regressive model
  
  This is an autoregressive transformer model that uses Feed-Forward Networks with
   (Fuzzy Tiling Activations)(index.html).
class_docstr_tok: ["#","#","Auto-Regressive","model","This","is","an","autoregressive","transformer","model","that","uses","Feed-Forward","Networks","with","(","Fuzzy","Tiling","Activations",")","(","index.html",")","."]
docstr: :param n_tokens: is the number of tokens in the vocabulary
  :param d_model: is the embedding size
  :param n_layers: is the number of transformer layers
  :param layer: is the layer. We use `n_layers` copies of this for the transformer.
docstr_tok: [":","param","n_tokens",":","is","the","number","of","tokens","in","the","vocabulary",":","param","d_model",":","is","the","embedding","size",":","param","n_layers",":","is","the","number","of","transformer","layers",":","param","layer",":","is","the","layer",".","We","use","`","n_layers","`","copies","of","this","for","the","transformer","."]
code: def __init__(
      self,
      n_tokens: int,
      d_model: int,
      n_layers: int,
      layer: TransformerLayer,
  ):
      """
      :param n_tokens: is the number of tokens in the vocabulary
      :param d_model: is the embedding size
      :param n_layers: is the number of transformer layers
      :param layer: is the layer. We use `n_layers` copies of this for the transformer.
      """
      super().__init__()
      # Transformer with `n_layers` layers
      self.transformer_layers = nn.ModuleList(
          [copy.deepcopy(layer) for _ in range(n_layers)]
      )
  
      # Token embedding layer
      self.emb = nn.Embedding(n_tokens, d_model)
      # Readout layer
      self.readout = nn.Linear(d_model, n_tokens)
  
      # The mask will be initialized on the first call
      self.mask = None
  
imports: import copy
  import torch
  import torch.nn
  from labml import experiment
  from labml.configs import option
  from labml_helpers.module import Module
  from labml_nn.activations.fta import FTA
  from labml_nn.experiments.nlp_autoregression import NLPAutoRegressionConfigs
  from labml_nn.transformers import MultiHeadAttention, TransformerLayer
  from labml_nn.transformers.utils import subsequent_mask
label_desc: Use image node_id 1 to create a new AutoregressiveTransformer object from inherited base classes: Module with example: obj = AutoregressiveTransformer(n_tokens, d_model, n_layers, layer)