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: Ids to embeddings with ids not in cluster mapped to the zero vector.
docstr_tok: ["Ids","to","embeddings","with","ids","not","in","cluster","mapped","to","the","zero","vector","."]
code: def ids_to_embedding(self, ids, context):
      """Ids to embeddings with ids not in cluster mapped to the zero vector."""
      ids -= self._start_token_id
      # The mtf.gather in the embedding's ids_to_embedding implementation will
      # cause the one hot representations of tokens greater than cluster vocab
      # dimension size to be the zero vector. Thus the embeddings for those tokens
      # will be the zero vector.
      ids = mtf.where(
          mtf.greater_equal(ids, 0), ids, self._end_token_id
      )
      return self._embedding.ids_to_embedding(ids, context)
  
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 _Cluster obj's underlying member method code with example usage: obj.ids_to_embedding(ids, context) and returns: self