Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::
ops::
Bincount
#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
-
arr: int32
Tensor
.
-
size: non-negative int32 scalar
Tensor
.
-
weights: is an int32, int64, float32, or float64
Tensor
with the same shape as
arr
, or a length-0
Tensor
, in which case it acts as all weights equal to 1.
Returns:
-
Output
: 1D
Tensor
with length equal to
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
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 2021-05-14 UTC.
[null,null,["Last updated 2021-05-14 UTC."],[],[],null,["# tensorflow::ops::Bincount Class Reference\n\ntensorflow::\nops::\nBincount\n===========================\n\n`\n#include \u003cmath_ops.h\u003e\n`\n\n\nCounts the number of occurrences of each value in an integer array.\n\nSummary\n-------\n\n\nOutputs a vector with length\n`\nsize\n`\nand the same dtype as\n`\nweights\n`\n. If\n`\nweights\n`\nare empty, then index\n`\ni\n`\nstores the number of times the value\n`\ni\n`\nis counted in\n`\narr\n`\n. If\n`\nweights\n`\nare non-empty, then index\n`\ni\n`\nstores the sum of the value in\n`\nweights\n`\nat each index where the corresponding value in\n`\narr\n`\nis\n`\ni\n`\n.\n\n\nValues in\n`\narr\n`\noutside of the range \\[0, size) are ignored.\n\n\nArgs:\n\n- scope: A [Scope](/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- arr: int32 `\n `[Tensor](/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor)`\n ` .\n- size: non-negative int32 scalar `\n `[Tensor](/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor)`\n ` .\n- weights: is an int32, int64, float32, or float64 `\n `[Tensor](/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor)`\n ` with the same shape as `\n arr\n ` , or a length-0 `\n `[Tensor](/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor)`\n ` , in which case it acts as all weights equal to 1.\n\n\u003cbr /\u003e\n\n\nReturns:\n\n- `\n `[Output](/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output)`\n ` : 1D `\n `[Tensor](/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor)`\n ` with length equal to `\n size\n ` . The counts or summed weights for each value in the range \\[0, size).\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| ` `[Bincount](#classtensorflow_1_1ops_1_1_bincount_1aab467738732ef3a8009ad662ba4d3821)` (const :: `[tensorflow::Scope](/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, :: `[tensorflow::Input](/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` arr, :: `[tensorflow::Input](/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` size, :: `[tensorflow::Input](/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` weights) ` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|\n| ` `[bins](#classtensorflow_1_1ops_1_1_bincount_1ac125b9a1515efa737f727151bfeaaa73)` ` | ` :: `[tensorflow::Output](/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output)` ` |\n| ` `[operation](#classtensorflow_1_1ops_1_1_bincount_1ab09a9d72c4506a6911bfbe00775dde37)` ` | ` `[Operation](/versions/r2.5/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation)` ` |\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------------|--------------------------|\n| ` `[node](#classtensorflow_1_1ops_1_1_bincount_1a4e41f60ef9fb7473b6aa1d8b939e11db)` () const ` | ` ::tensorflow::Node * ` |\n| ` `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_bincount_1a3ac1f5104aacae7c5ed57e9a2094a80a)` () const ` | ` ` |\n| ` `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_bincount_1a05eb54bb4dcf8b07c04cd58c4232d229)` () const ` | ` ` |\n\nPublic attributes\n-----------------\n\n### bins\n\n```text\n::tensorflow::Output bins\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\nPublic functions\n----------------\n\n### Bincount\n\n```gdscript\n Bincount(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input arr,\n ::tensorflow::Input size,\n ::tensorflow::Input weights\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```"]]