code: def __init__(
      self,
      vocab_size=30000,
      units=768,
      hidden_size=3072,
      num_layers=12,
      num_heads=12,
      max_length=512,
      hidden_dropout_prob=0.0,
      attention_dropout_prob=0.0,
      num_token_types=2,
      pos_embed_type="learned",
      activation="gelu",
      layer_norm_eps=1e-12,
      embed_initializer=TruncNorm(stdev=0.02),
      weight_initializer=TruncNorm(stdev=0.02),
      bias_initializer="zeros",
      dtype="float32",
      use_pooler=True,
      layout="NT",
      compute_layout="auto",
  ):
      super().__init__()
      self._dtype = dtype
      self.use_pooler = use_pooler
      self.pos_embed_type = pos_embed_type
      self.num_token_types = num_token_types
      self.vocab_size = vocab_size
      self.units = units
      self.max_length = max_length
      self.activation = activation
      self.embed_initializer = embed_initializer
      self.weight_initializer = weight_initializer
      self.bias_initializer = bias_initializer
      self.layer_norm_eps = layer_norm_eps
      self._layout = layout
      if compute_layout is None or compute_layout == "auto":
          self._compute_layout = layout
      else:
          self._compute_layout = compute_layout
      # Construct BertTransformer
      self.encoder = BertTransformer(
          units=units,
          hidden_size=hidden_size,
          num_layers=num_layers,
          num_heads=num_heads,
          attention_dropout_prob=attention_dropout_prob,
          hidden_dropout_prob=hidden_dropout_prob,
          output_attention=False,
          output_all_encodings=False,
          activation=activation,
          layer_norm_eps=layer_norm_eps,
          weight_initializer=weight_initializer,
          bias_initializer=bias_initializer,
          dtype=dtype,
          layout=self._compute_layout,
      )
      # Construct word embedding
      self.word_embed = nn.Embedding(
          input_dim=vocab_size,
          output_dim=units,
          weight_initializer=embed_initializer,
          dtype=dtype,
      )
      self.embed_layer_norm = nn.LayerNorm(
          epsilon=self.layer_norm_eps, in_channels=units
      )
      self.embed_dropout = nn.Dropout(hidden_dropout_prob)
      # Construct token type embedding
      self.token_type_embed = nn.Embedding(
          input_dim=num_token_types,
          output_dim=units,
          weight_initializer=weight_initializer,
      )
      self.token_pos_embed = PositionalEmbedding(
          units=units,
          max_length=max_length,
          dtype=self._dtype,
          method=pos_embed_type,
      )
      if self.use_pooler:
          # Construct pooler
          self.pooler = nn.Dense(
              units=units,
              in_units=units,
              flatten=False,
              activation="tanh",
              weight_initializer=weight_initializer,
              bias_initializer=bias_initializer,
          )
  
imports: import os
  from typing import Tuple
  import mxnet
  from mxnet import use_np, np, npx
  from mxnet.gluon import HybridBlock, nn
  from .base import BACKBONE_REGISTRY
  from .transformer import TransformerEncoderLayer
  from ..base import get_model_zoo_home_dir, get_repo_model_zoo_url, get_model_zoo_checksum_dir
  from ..utils.config import CfgNode
  from ..utils.misc import load_checksum_stats, download
  from ..utils.registry import Registry
  from ..initializer import TruncNorm
  from ..attention_cell import MultiHeadAttentionCell, gen_self_attn_mask
  from ..layers import get_activation, PositionalEmbedding, PositionwiseFFN, InitializerType
  from ..op import select_vectors_by_position
  from ..data.tokenizers import HuggingFaceWordPieceTokenizer
label_desc: Use image node_id 1 to create a new BertModel object from inherited base classes: HybridBlock with example: obj = BertModel(vocab_size, units, hidden_size, num_layers, num_heads, max_length, hidden_dropout_prob, attention_dropout_prob, num_token_types, pos_embed_type, activation, layer_norm_eps, embed_initializer, weight_initializer, bias_initializer, dtype, use_pooler, layout, compute_layout)