# tf.math.round

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/math/round) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.6.0/tensorflow/python/ops/math_ops.py#L897-L922) |

Rounds the values of a tensor to the nearest integer, element-wise.

#### View aliases


**Main aliases**

[`tf.round`](https://www.tensorflow.org/api_docs/python/tf/math/round)
**Compat aliases for migration**

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

[`tf.compat.v1.math.round`](https://www.tensorflow.org/api_docs/python/tf/math/round), [`tf.compat.v1.round`](https://www.tensorflow.org/api_docs/python/tf/math/round)

<br />

    tf.math.round(
        x, name=None
    )

Rounds half to even. Also known as bankers rounding. If you want to round
according to the current system rounding mode use tf::cint.
For example:

    x = tf.constant([0.9, 2.5, 2.3, 1.5, -4.5])
    tf.round(x)  # [ 1.0, 2.0, 2.0, 2.0, -4.0 ]

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | A `Tensor` of type `float16`, `float32`, `float64`, `int32`, or `int64`. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` of same shape and type as `x`. ||

<br />