class_docstr: Composite token embeddings.
  
  
  For each indexed token in a vocabulary, multiple embedding vectors, such as concatenated
  multiple embedding vectors, will be associated with it. Such embedding vectors can be loaded
  from externally hosted or custom pre-trained token embedding files, such as via token embedding
  instances.
  
  
  Parameters
  ----------
  vocabulary : :class:`~mxnet.contrib.text.vocab.Vocabulary`
      For each indexed token in a vocabulary, multiple embedding vectors, such as concatenated
      multiple embedding vectors, will be associated with it.
  token_embeddings : instance or list of `mxnet.contrib.text.embedding._TokenEmbedding`
      One or multiple pre-trained token embeddings to load. If it is a list of multiple
      embeddings, these embedding vectors will be concatenated for each token.
class_docstr_tok: ["Composite","token","embeddings",".","For","each","indexed","token","in","a","vocabulary",",","multiple","embedding","vectors",",","such","as","concatenated","multiple","embedding","vectors",",","will","be","associated","with","it",".","Such","embedding","vectors","can","be","loaded","from","externally","hosted","or","custom","pre-trained","token","embedding","files",",","such","as","via","token","embedding","instances",".","Parameters","--","--","--","--","--","vocabulary",":",":","class",":","`","~mxnet.contrib.text.vocab.Vocabulary","`","For","each","indexed","token","in","a","vocabulary",",","multiple","embedding","vectors",",","such","as","concatenated","multiple","embedding","vectors",",","will","be","associated","with","it",".","token_embeddings",":","instance","or","list","of","`","mxnet.contrib.text.embedding._TokenEmbedding","`","One","or","multiple","pre-trained","token","embeddings","to","load",".","If","it","is","a","list","of","multiple","embeddings",",","these","embedding","vectors","will","be","concatenated","for","each","token","."]
code: def __init__(self, vocabulary, token_embeddings):
      # Sanity checks.
      assert isinstance(vocabulary, vocab.Vocabulary), (
          "The argument `vocabulary` must be an instance of "
          "mxnet.contrib.text.indexer.Vocabulary."
      )
  
      if not isinstance(token_embeddings, list):
          token_embeddings = [token_embeddings]
  
      for embed in token_embeddings:
          assert isinstance(embed, _TokenEmbedding), (
              "The argument `token_embeddings` must be an instance or a list of instances "
              "of `mxnet.contrib.text.embedding.TextEmbedding` whose embedding vectors will be"
              "loaded or concatenated-then-loaded to map to the indexed tokens."
          )
  
      # Index tokens.
      self._index_tokens_from_vocabulary(vocabulary)
  
      # Set _idx_to_vec so that indices of tokens from keys of `counter` are associated with token
      # embedding vectors from `token_embeddings`.
      self._set_idx_to_vec_by_embeddings(
          token_embeddings, len(self), self.idx_to_token
      )
  
imports: import logging
  import os
  import tarfile
  import warnings
  import zipfile
  from .None import _constants
  from .None import vocab
  from ...None import ndarray
  from ...None import registry
  from ...None import base
  from ...util import is_np_array
  from ...None import numpy
  from ...None import numpy_extension
label_desc: Use image node_id 1 to create a new CompositeEmbedding object from inherited base classes: _TokenEmbedding with example: obj = CompositeEmbedding(vocabulary, token_embeddings)