fairseq2.nnΒΆ

This module contains various PyTorch modules and related APIs to help with building new model architectures. It follows similar conventions to torch.nn and can be considered an addendum to it.

        classDiagram
  ABC <|-- Embedding
  ABC <|-- IncrementalState
  ABC <|-- InterpolatedPositionEncoder
  ABC <|-- LayerNorm
  ABC <|-- PositionEncoder
  ABC <|-- Projection
  Embedding <|-- ShardedEmbedding
  Embedding <|-- StandardEmbedding
  Embedding <|-- VocabShardedEmbedding
  InterpolatedPositionEncoder <|-- SinusoidalNdPositionEncoder
  LayerNorm <|-- RMSNorm
  LayerNorm <|-- StandardLayerNorm
  Module <|-- Embedding
  Module <|-- InterpolatedPositionEncoder
  Module <|-- LayerNorm
  Module <|-- PositionEncoder
  Module <|-- Projection
  PositionEncoder <|-- LearnedPositionEncoder
  PositionEncoder <|-- RotaryEncoder
  PositionEncoder <|-- SinusoidalPositionEncoder
  Projection <|-- ColumnShardedLinear
  Projection <|-- Linear
  Projection <|-- RowShardedLinear
  Projection <|-- TiedProjection
  SinusoidalNdPositionEncoder <|-- Sinusoidal2dPositionEncoder
  SinusoidalNdPositionEncoder <|-- Sinusoidal3dPositionEncoder