class_docstr: ## Autoregressive language model
class_docstr_tok: ["#","#","Autoregressive","language","model"]
docstr: * `x` is the tensor with token indexes of shape `[seq_len, batch_size]`
docstr_tok: ["*","`","x","`","is","the","tensor","with","token","indexes","of","shape","`","[","seq_len",",","batch_size","]","`"]
code: def __call__(self, x: torch.Tensor):
      """
      * `x` is the tensor with token indexes of shape `[seq_len, batch_size]`
      """
      # Get embeddings
      x = self.embedding(x)
  
      # Add [positional embeddings](../positional_encoding.html)
      if self.pos_embedding is not None:
          x = self.pos_embedding(x * math.sqrt(self.d_model))
  
      # Hourglass
      x = self.hour_glass(x)
  
      # Get logits
      output = self.output(self.norm(x))
  
      # Return the logits
      return output, None
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/transformers/hour_glass/experiment.py
imports: import math
  from typing import List
  import torch
  from torch import nn
  from labml import experiment
  from labml.configs import option
  from labml_helpers.module import Module
  from labml_nn.experiments.nlp_autoregression import NLPAutoRegressionConfigs
  from labml_nn.transformers.hour_glass import HourGlass
  from labml_nn.transformers.positional_encoding import PositionalEncoding
label_desc: Use image node_id 2 for calling the AutoregressiveTransformer obj's underlying member method code with example usage: obj.__call__(x) and returns: output,  None