<br />

<button value="stable" default="">See Stable</button> <button value="nightly">See Nightly</button>

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/numpy.py#L5532-L5550) |

Returns the element-wise remainder of division with truncation.

#### View aliases


**Main aliases**

[`tf.keras.ops.numpy.fmod`](https://www.tensorflow.org/api_docs/python/tf/keras/ops/fmod.md.txt)

<br />

```python
tf.keras.ops.fmod(
    x1, x2
)
```

Computes the remainder complementary to the `floor_divide` function,
equivalent to the C library function `fmod`. The result has the same
sign as the dividend `x1`. This is different from [`keras.ops.mod`](https://www.tensorflow.org/api_docs/python/tf/keras/ops/mod.md.txt)
which has the same sign as the divisor `x2`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x1` | First tensor, the dividend. |
| `x2` | Second tensor, the divisor. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Output tensor, element-wise remainder with truncation. ||

<br />