# tf.raw_ops.HistogramFixedWidth

<br />

Return histogram of values.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.raw_ops.HistogramFixedWidth`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/HistogramFixedWidth)

<br />

    tf.raw_ops.HistogramFixedWidth(
        values,
        value_range,
        nbins,
        dtype=https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/dtypes#int32,
        name=None
    )

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]

    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 />

<br />

<br />

| ## Args ||
|---|---|
| `values` | A `Tensor`. Must be one of the following types: `int32`, `int64`, `float32`, `float64`. Numeric `Tensor`. |
| `value_range` | A `Tensor`. Must have the same type as `values`. Shape \[2\] `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` | A `Tensor` of type `int32`. Scalar `int32 Tensor`. Number of histogram bins. |
| `dtype` | An optional [`tf.DType`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/dtypes/DType) from: `tf.int32, tf.int64`. Defaults to [`tf.int32`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf#int32). |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` of type `dtype`. ||

<br />