Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.equal

Contents

jax.numpy.equal#

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

Returns element-wise truth value ofx==y.

JAX implementation ofnumpy.equal. This function provides the implementationof the== operator for JAX arrays.

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

  • y (ArrayLike) – input array or scalar.x andy should either have same shape or bebroadcast compatible.

Returns:

A boolean array containingTrue where the elements ofx==y andFalse otherwise.

Return type:

Array

See also

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==yArray([[ True, False, False],       [False,  True, False],       [False, False,  True]], dtype=bool)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp