class_docstr: Transformer encoder block.
class_docstr_tok: ["Transformer","encoder","block","."]
code: def forward(self, input: torch.Tensor):
      torch._assert(
          input.dim() == 3,
          f"Expected (batch_size, seq_length, hidden_dim) got {input.shape}",
      )
      x = self.ln_1(input)
      x, _ = self.self_attention(x, x, x, need_weights=False)
      x = self.dropout(x)
      x = x + input
  
      y = self.ln_2(x)
      y = self.mlp(y)
      return x + y
  
imports: import math
  from collections import OrderedDict
  from functools import partial
  from typing import Any, Callable, Dict, List, NamedTuple, Optional
  import torch
  import torch.nn
  from ..ops.misc import Conv2dNormActivation, MLP
  from ..transforms._presets import ImageClassification, InterpolationMode
  from ..utils import _log_api_usage_once
  from ._api import register_model, Weights, WeightsEnum
  from ._meta import _IMAGENET_CATEGORIES
  from ._utils import _ovewrite_named_param, handle_legacy_interface
label_desc: Use image node_id 2 for calling the EncoderBlock obj's underlying member method code with example usage: obj.forward(input) and returns: unknown