tft.hash_strings

View source on GitHub

Hash strings into buckets.

strings a Tensor or SparseTensor of dtype tf.string.
hash_buckets the number of hash buckets.
key optional. An array of two Python uint64. If passed, output will be a deterministic function of strings and key. Note that hashing will be slower if this value is specified.
name (Optional) A name for this operation.

A Tensor or SparseTensor of dtype tf.int64 with the same shape as the input strings.

TypeError if strings is not a Tensor or SparseTensor of dtype tf.string.