code: def __init__(
      self,
      use_bottleneck: bool = True,
      units: int = 512,
      hidden_size: int = 512,
      inner_size: int = 128,
      num_layers: int = 24,
      num_heads: int = 4,
      num_stacked_ffn: int = 1,
      bottleneck_strategy: str = "qk_sharing",
      activation: str = "gelu",
      normalization: str = "layer_norm",
      attention_dropout_prob: float = 0.0,
      hidden_dropout_prob: float = 0.1,
      output_attention: bool = False,
      output_all_encodings: bool = False,
      layer_norm_eps: float = 1e-12,
      weight_initializer: InitializerType = TruncNorm(stdev=0.02),
      bias_initializer: InitializerType = "zeros",
      dtype="float32",
      layout="NT",
  ):
      super().__init__()
      self._dtype = dtype
      self._num_layers = num_layers
      self._output_attention = output_attention
      self._output_all_encodings = output_all_encodings
      self._layout = layout
  
      assert bottleneck_strategy in [
          "qk_sharing",
          "from_bottleneck",
          "from_input",
      ], "The bottleneck strategy={} is not supported.".format(
          bottleneck_strategy
      )
      real_units = inner_size if use_bottleneck else units
      assert real_units % num_heads == 0, (
          "In MobileBertTransformer, The real_units should be divided exactly "
          "by the number of heads. Received real_units={}, num_heads={}".format(
              real_units, num_heads
          )
      )
  
      self.all_layers = nn.HybridSequential()
      for layer_idx in range(num_layers):
          self.all_layers.add(
              MobileBertEncoderLayer(
                  use_bottleneck=use_bottleneck,
                  units=units,
                  real_units=real_units,
                  hidden_size=hidden_size,
                  num_heads=num_heads,
                  attention_dropout_prob=attention_dropout_prob,
                  hidden_dropout_prob=hidden_dropout_prob,
                  num_stacked_ffn=num_stacked_ffn,
                  bottleneck_strategy=bottleneck_strategy,
                  layer_norm_eps=layer_norm_eps,
                  weight_initializer=weight_initializer,
                  bias_initializer=bias_initializer,
                  normalization=normalization,
                  activation=activation,
                  layout=layout,
              )
          )
  
imports: import os
  from typing import Tuple, Optional
  import mxnet
  from mxnet import use_np, np, npx
  from mxnet.gluon import HybridBlock, nn
  from .base import BACKBONE_REGISTRY
  from ..op import select_vectors_by_position
  from ..base import get_model_zoo_home_dir, get_repo_model_zoo_url, get_model_zoo_checksum_dir
  from ..layers import InitializerType, PositionwiseFFN, PositionalEmbedding, get_norm_layer, get_activation
  from ..initializer import TruncNorm
  from ..utils.config import CfgNode
  from ..utils.misc import load_checksum_stats, download
  from ..utils.registry import Registry
  from ..attention_cell import MultiHeadAttentionCell, gen_self_attn_mask
  from ..data.tokenizers import HuggingFaceWordPieceTokenizer
label_desc: Use image node_id 1 to create a new MobileBertTransformer object from inherited base classes: HybridBlock with example: obj = MobileBertTransformer(use_bottleneck, units, hidden_size, inner_size, num_layers, num_heads, num_stacked_ffn, bottleneck_strategy, activation, normalization, attention_dropout_prob, hidden_dropout_prob, output_attention, output_all_encodings, layer_norm_eps, weight_initializer, bias_initializer, dtype, layout)