# tf.math.maximum

<br />

|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/math/maximum) |

Returns the max of x and y (i.e. x \> y ? x : y) element-wise.

#### View aliases


**Main aliases**

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

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

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

<br />

    tf.math.maximum(
        x, y, name=None
    )

> [!NOTE]
> **Note:** [`math.maximum`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/math/maximum) supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | A `Tensor`. Must be one of the following types: `bfloat16`, `half`, `float32`, `float64`, `int32`, `int64`. |
| `y` | A `Tensor`. Must have the same type as `x`. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor`. Has the same type as `x`. ||

<br />