class_docstr: Represents a Transformer encoder.
class_docstr_tok: ["Represents","a","Transformer","encoder","."]
docstr: :param model_dim:
      The dimensionality of the model.
docstr_tok: [":","param","model_dim",":","The","dimensionality","of","the","model","."]
code: def __init__(self, model_dim: int) -> None:
      """
      :param model_dim:
          The dimensionality of the model.
      """
      super().__init__()
  
      self.model_dim = model_dim
  
      self._layer_output_hooks = OrderedDict()
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from collections import OrderedDict
  from typing import Dict, Iterable, Optional, Protocol, Tuple, final
  from torch import Tensor
  from torch.nn import Module
  from torch.utils.hooks import RemovableHandle
  from fairseq2.nn.module_list import ModuleList
  from fairseq2.nn.normalization import LayerNorm
  from fairseq2.nn.padding import PaddingMask
  from fairseq2.nn.transformer.attention_mask import AttentionMaskFactory
  from fairseq2.nn.transformer.encoder_layer import TransformerEncoderLayer
  from fairseq2.nn.transformer.layer_norm import LayerNormFactory, create_standard_layer_norm
  from fairseq2.nn.transformer.norm_order import TransformerNormOrder
  from fairseq2.typing import DataType, Device, finaloverride
label_desc: Use image node_id 1 to create a new TransformerEncoder object from inherited base classes: Module, ABC with example: obj = TransformerEncoder(model_dim)