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.
class_docstr_tok: ["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: Returns dimension used instead of sequence length for the cluster.
docstr_tok: ["Returns","dimension","used","instead","of","sequence","length","for","the","cluster","."]
code: def get_cluster_length_dim(self, length_dim):
      """Returns dimension used instead of sequence length for the cluster."""
      cluster_length = math.ceil(
          self._length_projection_factor * length_dim.size
      )
      return mtf.Dimension(length_dim.name, int(cluster_length))
  
imports: import math
  from typing import Dict, Sequence, Union
  import gin
  import mesh_tensorflow
  from mesh_tensorflow.transformer import transformer
  from mesh_tensorflow.transformer import vocab_embeddings
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 6 for calling the _Cluster obj's underlying member method code with example usage: obj.get_cluster_length_dim(length_dim) and returns: mtf