TransformerEncoder
- class torch.nn.TransformerEncoder(encoder_layer, num_layers, norm=None, enable_nested_tensor=True, mask_check=True)
TransformerEncoder is a stack of N encoder layers.
This TransformerEncoder layer implements the original architecture described in the paper. The intent of this layer is as a reference implementation for foundational understanding and thus it contains only limited features relative to newer Transformer architectures. Given the fast pace of innovation in transformer-like architectures, we recommend exploring this to build efficient layers from building blocks in core or using higher level libraries from the .