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.equal.html below:

jax.numpy.equal — JAX documentation

jax.numpy.equal#
jax.numpy.equal(x, y, /)[source]#

Returns element-wise truth value of x == y.

JAX implementation of numpy.equal. This function provides the implementation of the == operator for JAX arrays.

Parameters:
  • x (ArrayLike) – input array or scalar.

  • y (ArrayLike) – input array or scalar. x and y should either have same shape or be broadcast compatible.

Returns:

A boolean array containing True where the elements of x == y and False otherwise.

Return type:

Array

Examples

>>> jnp.equal(0., -0.)
Array(True, dtype=bool, weak_type=True)
>>> jnp.equal(1, 1.)
Array(True, dtype=bool, weak_type=True)
>>> jnp.equal(5, jnp.array(5))
Array(True, dtype=bool, weak_type=True)
>>> jnp.equal(2, -2)
Array(False, dtype=bool, weak_type=True)
>>> x = jnp.array([[1, 2, 3],
...                [4, 5, 6],
...                [7, 8, 9]])
>>> y = jnp.array([1, 5, 9])
>>> jnp.equal(x, y)
Array([[ True, False, False],
       [False,  True, False],
       [False, False,  True]], dtype=bool)
>>> x == y
Array([[ True, False, False],
       [False,  True, False],
       [False, False,  True]], dtype=bool)

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