class_docstr: Transformer encoder block, following https://arxiv.org/abs/2010.11929.
class_docstr_tok: ["Transformer","encoder","block",",","following","https",":","\/\/arxiv.org\/abs\/2010.11929","."]
code: def __init__(self, hidden_d, n_heads, mlp_d):
      super().__init__()
      self.ln_1 = layernorm(hidden_d)
      self.self_attention = MultiheadAttention(hidden_d, n_heads)
      self.ln_2 = layernorm(hidden_d)
      self.mlp_block = MLPBlock(hidden_d, mlp_d)
  
imports: import math
  import numpy
  import torch
  from pycls.core.config import cfg
  from pycls.models.blocks import activation, conv2d, conv2d_cx, layernorm, layernorm_cx, linear, linear_cx, MultiheadAttention, norm2d, norm2d_cx, patchify2d, patchify2d_cx
  from torch.nn import init, Module, Parameter
label_desc: Use image node_id 1 to create a new ViTEncoderBlock object from inherited base classes: Module with example: obj = ViTEncoderBlock(hidden_d, n_heads, mlp_d)