Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::RaggedBincount
#include <math_ops.h>
Counts the number of occurrences of each value in an integer array.
Summary
Outputs a vector with length size
and the same dtype as weights
. If weights
are empty, then index i
stores the number of times the value i
is counted in arr
. If weights
are non-empty, then index i
stores the sum of the value in weights
at each index where the corresponding value in arr
is i
.
Values in arr
outside of the range [0, size) are ignored.
Args:
- scope: A Scope object
- splits: 1D int64
Tensor
.
- values: 2D int
Tensor
.
- size: non-negative int scalar
Tensor
.
- weights: is an int32, int64, float32, or float64
Tensor
with the same shape as input
, or a length-0 Tensor
, in which case it acts as all weights equal to 1.
Optional attributes (see Attrs
):
- binary_output: bool; Whether the kernel should count the appearance or number of occurrences.
Returns:
Output
: 1D Tensor
with length equal to size
or 2D Tensor
with [batch_size, size
]. The counts or summed weights for each value in the range [0, size).
Public attributes
Public functions
node
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Public static functions
BinaryOutput
Attrs BinaryOutput(
bool x
)
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. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tensorflow::ops::RaggedBincount Class Reference\n\ntensorflow::ops::RaggedBincount\n===============================\n\n`#include \u003cmath_ops.h\u003e`\n\nCounts the number of occurrences of each value in an integer array.\n\nSummary\n-------\n\nOutputs a vector with length `size` and the same dtype as `weights`. If `weights` are empty, then index `i` stores the number of times the value `i` is counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of the value in `weights` at each index where the corresponding value in `arr` is `i`.\n\nValues in `arr` outside of the range \\[0, size) are ignored.\n\nArgs:\n\n- scope: A [Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- splits: 1D int64 [Tensor](/versions/r2.14/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor).\n- values: 2D int [Tensor](/versions/r2.14/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor).\n- size: non-negative int scalar [Tensor](/versions/r2.14/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor).\n- weights: is an int32, int64, float32, or float64 [Tensor](/versions/r2.14/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) with the same shape as `input`, or a length-0 [Tensor](/versions/r2.14/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor), in which case it acts as all weights equal to 1.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/ragged-bincount/attrs#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs)):\n\n- binary_output: bool; Whether the kernel should count the appearance or number of occurrences.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): 1D [Tensor](/versions/r2.14/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) with length equal to `size` or 2D [Tensor](/versions/r2.14/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) with \\[batch_size, `size`\\]. The counts or summed weights for each value in the range \\[0, size).\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [RaggedBincount](#classtensorflow_1_1ops_1_1_ragged_bincount_1af6554de96f809fccbd678adaffbc3c24)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` splits, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` values, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` size, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` weights)` ||\n| [RaggedBincount](#classtensorflow_1_1ops_1_1_ragged_bincount_1ab10c029cf1e632fc88ce35a983cecd43)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` splits, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` values, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` size, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` weights, const `[RaggedBincount::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/ragged-bincount/attrs#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_ragged_bincount_1a733325350aabe10af880482ad5e1f9e0) | [Operation](/versions/r2.14/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_ragged_bincount_1a29aa4960a91cfce90a6ff9b5bdd8f47d) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|---------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_ragged_bincount_1ab80b688c6e079f3cb485c27bae9fc4f6)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_ragged_bincount_1a3ee830fe3366afe1d6d8185e5d362999)`() const ` | |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_ragged_bincount_1a0258579a8e475e40192adf1f9d54b806)`() const ` | |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| [BinaryOutput](#classtensorflow_1_1ops_1_1_ragged_bincount_1a9853523da24b28968c4a53efae303ab9)`(bool x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/ragged-bincount/attrs#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs) |\n\n| ### Structs ||\n|-------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::RaggedBincount::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/ragged-bincount/attrs) | Optional attribute setters for [RaggedBincount](/versions/r2.14/api_docs/cc/class/tensorflow/ops/ragged-bincount#classtensorflow_1_1ops_1_1_ragged_bincount). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### RaggedBincount\n\n```gdscript\n RaggedBincount(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input splits,\n ::tensorflow::Input values,\n ::tensorflow::Input size,\n ::tensorflow::Input weights\n)\n``` \n\n### RaggedBincount\n\n```gdscript\n RaggedBincount(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input splits,\n ::tensorflow::Input values,\n ::tensorflow::Input size,\n ::tensorflow::Input weights,\n const RaggedBincount::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### BinaryOutput\n\n```text\nAttrs BinaryOutput(\n bool x\n)\n```"]]