class_docstr: A vocab embedding assigning variable capacity to clusters of tokens.
  
  Similar to the adaptive input representations in this paper
  (https://arxiv.org/abs/1809.10853). However, they use an adaptive softmax to
  compute logits while this embedding uses a regular softmax.
  
  The idea is to create clusters of tokens and assign different capacity to
  different clusters by factoring their embedding matrices to different inner
  dimensions.
  
  The clustering can be done by word frequency with more frequent tokens getting
  higher capacity. In this implementation, token ids of clusters must be
  contiguous in the vocabulary.
  
  Interface matches mesh_tensorflow.transformer VocabEmbedding object.
code: def ids_to_embedding(self, ids, context):
      # Ids not in each cluster will be mapped to the zero vector. Since clusters
      # are disjoint, this sum is correct.
      return sum(
          cluster.ids_to_embedding(ids, context)
          for cluster in self._clusters
      )
  
imports: import gin
  import mesh_tensorflow
  from mesh_tensorflow.transformer import transformer
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the AdaptiveVocabEmbedding obj's underlying member method code with example usage: obj.ids_to_embedding(ids, context) and returns: sum