tft.count_per_key  |  TFX  |  TensorFlow (original) (raw)

tft.count_per_key

Stay organized with collections Save and categorize content based on your preferences.

Computes the count of each element of a Tensor.

tft.count_per_key(
    key: common_types.TensorType,
    key_vocabulary_filename: Optional[str] = None,
    name: Optional[str] = None
)
Args
key A Tensor, SparseTensor, or RaggedTensor of dtype tf.string or tf.int.
key_vocabulary_filename (Optional) The file name for the key-output mapping file. If None and key are provided, this combiner assumes the keys fit in memory and will not store the result in a file. If empty string, a file name will be chosen based on the current scope. If not an empty string, should be unique within a given preprocessing function.
name (Optional) A name for this operation.
Returns
Either (A) Two Tensors: one the key vocab with dtype of input; the other the count for each key, dtype tf.int64. (if key_vocabulary_filename is None). (B) The filename where the key-value mapping is stored (if key_vocabulary_filename is not None).
Raises
TypeError If the type of x is not supported.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-11-01 UTC.