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 Tensor s: 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-01 UTC."],[],[]]