docstr: Parameters
  ----------
  vocab_size
  units
  hidden_size
  num_layers
  num_heads
  max_length
  hidden_dropout_prob
  attention_dropout_prob
  pos_embed_type
  activation
  pooler_activation
  layer_norm_eps
  embed_initializer
  weight_initializer
  bias_initializer
  dtype
  use_pooler
      Whether to output the CLS hidden state
  classifier_activation
      Whether to use classification head
  encoder_normalize_before
      Whether to normalize before the
  output_all_encodings
      Whether to output all encodings
  layout
      The layout
  compute_layout
      The computation layout
docstr_tok: ["Parameters","--","--","--","--","--","vocab_size","units","hidden_size","num_layers","num_heads","max_length","hidden_dropout_prob","attention_dropout_prob","pos_embed_type","activation","pooler_activation","layer_norm_eps","embed_initializer","weight_initializer","bias_initializer","dtype","use_pooler","Whether","to","output","the","CLS","hidden","state","classifier_activation","Whether","to","use","classification","head","encoder_normalize_before","Whether","to","normalize","before","the","output_all_encodings","Whether","to","output","all","encodings","layout","The","layout","compute_layout","The","computation","layout"]
code: def __init__(
      self,
      vocab_size=50265,
      units=768,
      hidden_size=3072,
      num_layers=12,
      num_heads=12,
      max_length=512,
      hidden_dropout_prob=0.1,
      attention_dropout_prob=0.1,
      pos_embed_type="learned",
      activation="gelu",
      pooler_activation="tanh",
      layer_norm_eps=1e-5,
      embed_initializer=TruncNorm(stdev=0.02),
      weight_initializer=TruncNorm(stdev=0.02),
      bias_initializer="zeros",
      dtype="float32",
      use_pooler=True,
      classifier_activation=False,
      encoder_normalize_before=True,
      output_all_encodings=False,
      layout="NT",
      compute_layout="auto",
  ):
      """
  
      Parameters
      ----------
      vocab_size
      units
      hidden_size
      num_layers
      num_heads
      max_length
      hidden_dropout_prob
      attention_dropout_prob
      pos_embed_type
      activation
      pooler_activation
      layer_norm_eps
      embed_initializer
      weight_initializer
      bias_initializer
      dtype
      use_pooler
          Whether to output the CLS hidden state
      classifier_activation
          Whether to use classification head
      encoder_normalize_before
          Whether to normalize before the
      output_all_encodings
          Whether to output all encodings
      layout
          The layout
      compute_layout
          The computation layout
      """
      super().__init__()
      self._dtype = dtype
      self._output_all_encodings = output_all_encodings
      self.vocab_size = vocab_size
      self.units = units
      self.hidden_size = hidden_size
      self.num_layers = num_layers
      self.num_heads = num_heads
      self.max_length = max_length
      self.hidden_dropout_prob = hidden_dropout_prob
      self.attention_dropout_prob = attention_dropout_prob
      self.pos_embed_type = pos_embed_type
      self.activation = activation
      self.pooler_activation = pooler_activation
      self.layer_norm_eps = layer_norm_eps
      self.use_pooler = use_pooler
      self.classifier_activation = classifier_activation
      self.encoder_normalize_before = encoder_normalize_before
      self.weight_initializer = weight_initializer
      self.bias_initializer = bias_initializer
      self._layout = layout
      if compute_layout == "auto" or compute_layout is None:
          self._compute_layout = layout
      else:
          self._compute_layout = compute_layout
      self.word_embed = nn.Embedding(
          input_dim=self.vocab_size,
          output_dim=self.units,
          weight_initializer=embed_initializer,
          dtype=self._dtype,
      )
      if self.encoder_normalize_before:
          self.embed_ln = nn.LayerNorm(
              epsilon=self.layer_norm_eps, in_channels=self.units
          )
      self.embed_dropout = nn.Dropout(self.hidden_dropout_prob)
      self.pos_embed = PositionalEmbedding(
          units=self.units,
          max_length=self.max_length,
          dtype=self._dtype,
          method=pos_embed_type,
      )
  
      self.encoder = RobertaEncoder(
          units=self.units,
          hidden_size=self.hidden_size,
          num_layers=self.num_layers,
          num_heads=self.num_heads,
          attention_dropout_prob=self.attention_dropout_prob,
          hidden_dropout_prob=self.hidden_dropout_prob,
          layer_norm_eps=self.layer_norm_eps,
          weight_initializer=weight_initializer,
          bias_initializer=bias_initializer,
          activation=self.activation,
          dtype=self._dtype,
          output_all_encodings=self._output_all_encodings,
          layout=self._compute_layout,
      )
  
      if self.use_pooler and self.classifier_activation:
          # Construct pooler
          self.pooler = nn.Dense(
              units=self.units,
              in_units=self.units,
              flatten=False,
              activation=self.pooler_activation,
              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 ..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 PositionalEmbedding, get_activation
  from ..utils.misc import download, load_checksum_stats
  from ..utils.registry import Registry
  from .transformer import TransformerEncoderLayer
  from ..initializer import TruncNorm
  from ..utils.config import CfgNode
  from ..attention_cell import gen_self_attn_mask
  from ..data.tokenizers import HuggingFaceByteBPETokenizer
label_desc: Use image node_id 1 to create a new RobertaModel object from inherited base classes: HybridBlock with example: obj = RobertaModel(vocab_size, units, hidden_size, num_layers, num_heads, max_length, hidden_dropout_prob, attention_dropout_prob, pos_embed_type, activation, pooler_activation, layer_norm_eps, embed_initializer, weight_initializer, bias_initializer, dtype, use_pooler, classifier_activation, encoder_normalize_before, output_all_encodings, layout, compute_layout)