class_docstr: Transformer encoder (sequence of ViTEncoderBlocks).
class_docstr_tok: ["Transformer","encoder","(","sequence","of","ViTEncoderBlocks",")","."]
code: def __init__(self, n_layers, hidden_d, n_heads, mlp_d):
      super(ViTEncoder, self).__init__()
      for i in range(n_layers):
          self.add_module(
              f"block_{i}", ViTEncoderBlock(hidden_d, n_heads, mlp_d)
          )
      self.ln = layernorm(hidden_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 ViTEncoder object from inherited base classes: Module with example: obj = ViTEncoder(n_layers, hidden_d, n_heads, mlp_d)