class_docstr: Transformer model from `"Attention Is All You Need" (Vaswani, et al, 2017)
  <https://arxiv.org/abs/1706.03762>`_.
class_docstr_tok: ["Transformer","model","from","`","``","Attention","Is","All","You","Need","''","(","Vaswani",",","et","al",",","2017",")","<","https",":","\/\/arxiv.org\/abs\/1706.03762",">","`","_","."]
code: def __init__(self, task, encoder, decoder):
      super().__init__(encoder, decoder)
      self.task = task
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import options, utils
  from fairseq.models import FairseqEncoderDecoderModel, FairseqIncrementalDecoder, register_model, register_model_architecture, transformer
  from fairseq.modules import AdaptiveSoftmax, LearnedPositionalEmbedding, MultiheadAttention, SinusoidalPositionalEmbedding
  from pytorch_translate import transformer, vocab_reduction
  from pytorch_translate.average_attention import AverageAttention, AverageWindowAttention
  from pytorch_translate.utils import torch_find
label_desc: Use image node_id 1 to create a new TransformerAANModel object from inherited base classes: FairseqEncoderDecoderModel with example: obj = TransformerAANModel(task, encoder, decoder)