class_docstr: Helper class for adaptive embeddings specifying a cluster of tokens.
  
  Essentially a wrapper around a vocab embedding for the cluster with additional
  metadata so that we can apply the embedding to the actual ids and hidden
  states.
docstr: Cluster constructor.
  
  Args:
    embedding: a FactorizedVocabEmbedding or transformer.VocabEmbedding, the
      vocab embedding to use for the cluster
    start_token_id: an integer, the inclusive id of the first token in the
      cluster
    end_token_id: an integer, the exclusive id of the last token in the
      cluster
docstr_tok: ["Cluster","constructor",".","Args",":","embedding",":","a","FactorizedVocabEmbedding","or","transformer.VocabEmbedding",",","the","vocab","embedding","to","use","for","the","cluster","start_token_id",":","an","integer",",","the","inclusive","id","of","the","first","token","in","the","cluster","end_token_id",":","an","integer",",","the","exclusive","id","of","the","last","token","in","the","cluster"]
code: def __init__(self, embedding, start_token_id, end_token_id):
      """Cluster constructor.
  
      Args:
        embedding: a FactorizedVocabEmbedding or transformer.VocabEmbedding, the
          vocab embedding to use for the cluster
        start_token_id: an integer, the inclusive id of the first token in the
          cluster
        end_token_id: an integer, the exclusive id of the last token in the
          cluster
      """
      self._embedding = embedding
      self._start_token_id = start_token_id
      self._end_token_id = end_token_id
  
imports: import gin
  import mesh_tensorflow
  from mesh_tensorflow.transformer import transformer
  import tensorflow.compat.v1
label_desc: Use image node_id 1 to create a new _Cluster object from inherited base classes: object with example: obj = _Cluster(embedding, start_token_id, end_token_id)