# tensorflow::ops::HistogramFixedWidth Class Reference

# tensorflow::
ops::
HistogramFixedWidth

`
#include <math_ops.h>
`


Return histogram of values.

## Summary


Given the tensor
`
values
`
, this operation returns a rank 1 histogram counting the number of entries in
`
values
`
that fall into every bin. The bins are equal width and determined by the arguments
`
value_range
`
and
`
nbins
`
.


```
# Bins will be:  (-inf, 1), [1, 2), [2, 3), [3, 4), [4, inf)
nbins = 5
value_range = [0.0, 5.0]
new_values = [-1.0, 0.0, 1.5, 2.0, 5.0, 15]
```

<br />


```
with tf.get_default_session() as sess:
  hist = tf.histogram_fixed_width(new_values, value_range, nbins=5)
  variables.global_variables_initializer().run()
  sess.run(hist) => [2, 1, 1, 0, 2]
```

<br />


Args:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- values: Numeric `
  https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor
  ` .
- value_range: Shape \[2\] `
  https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor
  ` of same `
  dtype
  ` as `
  values
  ` . values \<= value_range\[0\] will be mapped to hist\[0\], values \>= value_range\[1\] will be mapped to hist\[-1\].
- nbins: Scalar `
  int32
  https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor
  ` . Number of histogram bins.

<br />


Returns:

- `
  https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` : A 1-D `
  https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor
  ` holding histogram of values.

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/histogram-fixed-width#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a333002784eada5d11649a32ff58a5bce (const :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input values, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input value_range, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input nbins) ` ||
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/histogram-fixed-width#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a1284e095c6b69e072988d8beecea179f (const :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input values, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input value_range, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input nbins, const https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/histogram-fixed-width/attrs#structtensorflow_1_1ops_1_1_histogram_fixed_width_1_1_attrs & attrs) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/histogram-fixed-width#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a34fee699d7f4fdb4577eb33f6f46c23c ` | ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/histogram-fixed-width#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a587b8e7c9541b52daed045e791a0520d ` | ` :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output ` |

| ### Public functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/histogram-fixed-width#classtensorflow_1_1ops_1_1_histogram_fixed_width_1afa5f92867dd3834b3808d6d25177c002 () const ` | ` ::tensorflow::Node * ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/histogram-fixed-width#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a699360f21e94439323f32adaa8b09e30 () const ` | ` ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/histogram-fixed-width#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a4136d809be17e0bbd261e44d9dd9b377 () const ` | ` ` |

| ### Public static functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/histogram-fixed-width#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a9856da0e7bf5f4751e54495801a9f8e2 (DataType x) ` | ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/histogram-fixed-width/attrs#structtensorflow_1_1ops_1_1_histogram_fixed_width_1_1_attrs ` |

| ### Structs ||
|---|---|
| [tensorflow:: ops:: HistogramFixedWidth:: Attrs](https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/histogram-fixed-width/attrs) | Optional attribute setters for [HistogramFixedWidth](https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/histogram-fixed-width#classtensorflow_1_1ops_1_1_histogram_fixed_width) . |

## Public attributes

### operation

```
Operation operation
```

### out

```
::tensorflow::Output out
```

## Public functions

### HistogramFixedWidth

```
 HistogramFixedWidth(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input values,
  ::tensorflow::Input value_range,
  ::tensorflow::Input nbins
)
```

### HistogramFixedWidth

```
 HistogramFixedWidth(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input values,
  ::tensorflow::Input value_range,
  ::tensorflow::Input nbins,
  const HistogramFixedWidth::Attrs & attrs
)
```

### node

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

### operator::tensorflow::Input

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

### operator::tensorflow::Output

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

## Public static functions

### Dtype

```
Attrs Dtype(
  DataType x
)
```