# tensorflow::ops::RaggedBincount Class Reference

# 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](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- splits: 1D int64 `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor
  ` .
- values: 2D int `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor
  ` .
- size: non-negative int scalar `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor
  ` .
- weights: is an int32, int64, float32, or float64 `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor
  ` with the same shape as `
  input
  ` , or a length-0 `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor
  ` , in which case it acts as all weights equal to 1.

<br />


Optional attributes (see
`
https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/ragged-bincount/attrs#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs
`
):

- binary_output: bool; Whether the kernel should count the appearance or number of occurrences.

<br />


Returns:

- `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` : 1D `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor
  ` with length equal to `
  size
  ` or 2D `
  https://www.tensorflow.org/versions/r2.5/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).

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/ragged-bincount#classtensorflow_1_1ops_1_1_ragged_bincount_1af6554de96f809fccbd678adaffbc3c24 (const :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input splits, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input values, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input size, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input weights) ` ||
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/ragged-bincount#classtensorflow_1_1ops_1_1_ragged_bincount_1ab10c029cf1e632fc88ce35a983cecd43 (const :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input splits, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input values, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input size, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input weights, const https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/ragged-bincount/attrs#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs & attrs) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/ragged-bincount#classtensorflow_1_1ops_1_1_ragged_bincount_1a733325350aabe10af880482ad5e1f9e0 ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/ragged-bincount#classtensorflow_1_1ops_1_1_ragged_bincount_1a29aa4960a91cfce90a6ff9b5bdd8f47d ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output ` |

| ### Public functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/ragged-bincount#classtensorflow_1_1ops_1_1_ragged_bincount_1ab80b688c6e079f3cb485c27bae9fc4f6 () const ` | ` ::tensorflow::Node * ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/ragged-bincount#classtensorflow_1_1ops_1_1_ragged_bincount_1a3ee830fe3366afe1d6d8185e5d362999 () const ` | ` ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/ragged-bincount#classtensorflow_1_1ops_1_1_ragged_bincount_1a0258579a8e475e40192adf1f9d54b806 () const ` | ` ` |

| ### Public static functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/ragged-bincount#classtensorflow_1_1ops_1_1_ragged_bincount_1a9853523da24b28968c4a53efae303ab9 (bool x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/ragged-bincount/attrs#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs ` |

| ### Structs ||
|---|---|
| [tensorflow:: ops:: RaggedBincount:: Attrs](https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/ragged-bincount/attrs) | Optional attribute setters for [RaggedBincount](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/ragged-bincount#classtensorflow_1_1ops_1_1_ragged_bincount) . |

## Public attributes

### operation

```
Operation operation
```

### output

```
::tensorflow::Output output
```

## Public functions

### RaggedBincount

```
 RaggedBincount(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input splits,
  ::tensorflow::Input values,
  ::tensorflow::Input size,
  ::tensorflow::Input weights
)
```

### RaggedBincount

```
 RaggedBincount(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input splits,
  ::tensorflow::Input values,
  ::tensorflow::Input size,
  ::tensorflow::Input weights,
  const RaggedBincount::Attrs & attrs
)
```

### node

```
::tensorflow::Node * node() const 
```

### operator::tensorflow::Input

```
 operator::tensorflow::Input() const 
```

### operator::tensorflow::Output

```
 operator::tensorflow::Output() const 
```

## Public static functions

### BinaryOutput

```
Attrs BinaryOutput(
  bool x
)
```