A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.jax.dev/en/latest/_autosummary/jax.numpy.remainder.html below:

jax.numpy.remainder — JAX documentation

jax.numpy.remainder#
jax.numpy.remainder(x1, x2, /)[source]#

Returns element-wise remainder of the division.

JAX implementation of numpy.remainder.

Parameters:
  • x1 (ArrayLike) – scalar or array. Specifies the dividend.

  • x2 (ArrayLike) – scalar or array. Specifies the divisor. x1 and x2 should either have same shape or be broadcast compatible.

Returns:

An array containing the remainder of element-wise division of x1 by x2 with same sign as the elements of x2.

Return type:

Array

Note

The result of jnp.remainder is equivalent to x1 - x2 * jnp.floor(x1 / x2).

See also

Examples

>>> x1 = jnp.array([[3, -1, 4],
...                 [8, 5, -2]])
>>> x2 = jnp.array([2, 3, -5])
>>> jnp.remainder(x1, x2)
Array([[ 1,  2, -1],
       [ 0,  2, -2]], dtype=int32)
>>> x1 - x2 * jnp.floor(x1 / x2)
Array([[ 1.,  2., -1.],
       [ 0.,  2., -2.]], dtype=float32)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3