def _hash_bucket_tensors(self, ids: tf.Tensor, num_hashes: int,
                           num_buckets: int) -> Sequence[tf.Tensor]:
    """Converts ids to hash bucket ids via multiple hashing.

    Args:
      ids: The codepoints or other IDs to be hashed.
      num_hashes: The number of hash functions to use.
      num_buckets: The number of hash buckets (i.e. embeddings in each table).

    Returns:
      A sequence of tensors, each of which is the hash bucket IDs from one hash
      function.
    """
    if num_hashes > len(_PRIMES):
      raise ValueError(f"`num_hashes` must be <= {len(_PRIMES)}")

    primes = _PRIMES[:num_hashes]

    result_tensors = []
    for prime in primes:
      hashed = ((ids + 1) * prime) % num_buckets
      result_tensors.append(hashed)
    return result_tensors
Converts ids to hash bucket ids via multiple hashing.

    Args:
      ids: The codepoints or other IDs to be hashed.
      num_hashes: The number of hash functions to use.
      num_buckets: The number of hash buckets (i.e. embeddings in each table).

    Returns:
      A sequence of tensors, each of which is the hash bucket IDs from one hash
      function.
    
language/canine/modeling.py