class_docstr: A module that directly utilizes the pretrained models in `transformers`_ to produce BERT representations.
  
  While mainly tailored to provide input preparation and post-processing for the BERT model,
  it is also compatiable with other pretrained language models like XLNet, RoBERTa and ELECTRA, etc.
  
  Args:
      model (str):
          Path or name of the pretrained models registered in `transformers`_, e.g., ``'bert-base-cased'``.
      n_layers (int):
          The number of layers from the model to use.
          If 0, uses all layers.
      n_out (int):
          The requested size of the embeddings.
          If 0, uses the size of the pretrained embedding model.
      pad_index (int):
          The index of the padding token in the BERT vocabulary. Default: 0.
      max_len (int):
          Sequences should not exceed the specfied max length. Default: 512.
      dropout (float):
          The dropout ratio of BERT layers. Default: 0.
          This value will be passed into the :class:`ScalarMix` layer.
      requires_grad (bool):
          If ``True``, the model parameters will be updated together with the downstream task.
          Default: ``False``.
  
  .. _transformers:
      https://github.com/huggingface/transformers
code: def __repr__(self):
      s = f"{self.model}, n_layers={self.n_layers}, n_out={self.n_out}, pad_index={self.pad_index}"
      if self.max_len is not None:
          s += f", max_len={self.max_len}"
      if self.dropout > 0:
          s += f", dropout={self.dropout}"
      if self.requires_grad:
          s += f", requires_grad={self.requires_grad}"
  
      return f"{self.__class__.__name__}({s})"
  
file_path: underthesea/underthesea/modules/bert.py
imports: import torch.nn
  from torch.nn.utils.rnn import pad_sequence
  from transformers import AutoConfig, AutoModel
  from underthesea.modules.scalar_mix import ScalarMix
label_desc: Use image node_id 2 for calling the BertEmbedding obj's underlying member method code with example usage: obj.__repr__() and returns: self, str, s, str