View source on GitHub
|
Hash strings into buckets.
tft.hash_strings(
strings: common_types.ConsistentTensorType,
hash_buckets: int,
key: Optional[Iterable[int]] = None,
name: Optional[str] = None
) -> common_types.ConsistentTensorType
Args |
|---|
strings: a Tensor, SparseTensor, or RaggedTensor 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.
Returns |
|---|
A Tensor, SparseTensor, or RaggedTensor of dtype tf.int64 with the
same shape as
the input strings.
Raises |
|---|
TypeError: if strings is not a Tensor, SparseTensor, or RaggedTensor
of dtype tf.string.
View source on GitHub