docstr: Get the initial token embeddings that considers the token type and positional embeddings
  
  Parameters
  ----------
  inputs
      - layout = 'NT'
          Shape (batch_size, seq_length)
      - layout = 'TN'
          Shape (seq_length, batch_size)
  
  token_types
      Type of tokens. If None, it will be initialized as all zero
  
      - layout = 'NT'
          Shape (batch_size, seq_length)
      - layout = 'TN'
          Shape (seq_length, batch_size)
  
  Returns
  -------
  embedding
      The initial embedding that will be fed into the encoder
docstr_tok: ["Get","the","initial","token","embeddings","that","considers","the","token","type","and","positional","embeddings","Parameters","--","--","--","--","--","inputs","-","layout","=","'NT'","Shape","(","batch_size",",","seq_length",")","-","layout","=","'TN'","Shape","(","seq_length",",","batch_size",")","token_types","Type","of","tokens",".","If","None",",","it","will","be","initialized","as","all","zero","-","layout","=","'NT'","Shape","(","batch_size",",","seq_length",")","-","layout","=","'TN'","Shape","(","seq_length",",","batch_size",")","Returns","--","--","--","-","embedding","The","initial","embedding","that","will","be","fed","into","the","encoder"]
code: def get_initial_embedding(self, inputs, token_types=None):
      """Get the initial token embeddings that considers the token type and positional embeddings
  
      Parameters
      ----------
      inputs
          - layout = 'NT'
              Shape (batch_size, seq_length)
          - layout = 'TN'
              Shape (seq_length, batch_size)
  
      token_types
          Type of tokens. If None, it will be initialized as all zero
  
          - layout = 'NT'
              Shape (batch_size, seq_length)
          - layout = 'TN'
              Shape (seq_length, batch_size)
  
      Returns
      -------
      embedding
          The initial embedding that will be fed into the encoder
      """
      if self._layout == "NT":
          batch_axis, time_axis = 0, 1
      elif self._layout == "TN":
          batch_axis, time_axis = 1, 0
      else:
          raise NotImplementedError
      word_embedding = self.word_embed(inputs)
  
      if self.trigram_embed:
          if self._layout == "NT":
              word_embedding = np.concatenate(
                  [
                      np.pad(
                          word_embedding[:, 1:],
                          ((0, 0), (0, 1), (0, 0)),
                      ),
                      word_embedding,
                      np.pad(
                          word_embedding[:, :-1],
                          ((0, 0), (1, 0), (0, 0)),
                      ),
                  ],
                  axis=-1,
              )
          elif self._layout == "TN":
              word_embedding = np.concatenate(
                  [
                      np.pad(
                          word_embedding[1:, :],
                          ((0, 1), (0, 0), (0, 0)),
                      ),
                      word_embedding,
                      np.pad(
                          word_embedding[:-1, :],
                          ((1, 0), (0, 0), (0, 0)),
                      ),
                  ],
                  axis=-1,
              )
          else:
              raise NotImplementedError
      # Projecting the embedding into units only for word embedding
      if self.trigram_embed or self.embed_size != self.units:
          word_embedding = self.embed_factorized_proj(word_embedding)
  
      if token_types is None:
          token_types = np.zeros_like(inputs)
      type_embedding = self.token_type_embed(token_types)
      embedding = word_embedding + type_embedding
      if self.pos_embed_type is not None:
          positional_embedding = self.token_pos_embed(
              npx.arange_like(embedding, axis=time_axis)
          )
          positional_embedding = np.expand_dims(
              positional_embedding, axis=batch_axis
          )
          embedding = embedding + positional_embedding
      # Extra layer normalization plus dropout
      embedding = self.embed_layer_norm(embedding)
      embedding = self.embed_dropout(embedding)
      return embedding
  
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 5 for calling the MobileBertModel obj's underlying member method code with example usage: obj.get_initial_embedding(inputs, token_types) and returns: embedding