class_docstr: A wrapper around `Transformer` turning it into an Encoder by setting the following:
      - is_decoder=False
      - seq_length=0
      - encoder_output=None
class_docstr_tok: ["A","wrapper","around","`","Transformer","`","turning","it","into","an","Encoder","by","setting","the","following",":","-","is_decoder=False","-","seq_length=0","-","encoder_output=None"]
code: def __init__(
      self,
      num_layers: int,
      num_heads: int,
      hidden_dim: int,
      mlp_expansion: int,
      dropout: float,
      norm_layer: Callable[..., torch.nn.Module] = partial(
          nn.LayerNorm, eps=1e-6
      ),
  ) -> None:
      super().__init__(
          seq_length=0,  # NO-OP: used for look_ahead_mask only, no masking in encoder
          num_layers=num_layers,
          num_heads=num_heads,
          hidden_dim=hidden_dim,
          mlp_expansion=mlp_expansion,
          dropout=dropout,
          is_decoder=False,
          norm_layer=norm_layer,
      )
  
imports: from functools import partial
  from typing import Callable, Optional
  import torch
  import torch.nn
  from torch import Tensor
  from .layers_utils import MLP, StochasticDepth, WindowMultiHeadAttention
label_desc: Use image node_id 1 to create a new EncoderSection object from inherited base classes: Transformer with example: obj = EncoderSection(num_layers, num_heads, hidden_dim, mlp_expansion, dropout, norm_layer)