Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.array_equal

Contents

jax.numpy.array_equal#

jax.numpy.array_equal(a1,a2,equal_nan=False)[source]#

Check if two arrays are element-wise equal.

JAX implementation ofnumpy.array_equal().

Parameters:
  • a1 (ArrayLike) – first input array to compare.

  • a2 (ArrayLike) – second input array to compare.

  • equal_nan (bool) – Boolean. IfTrue, NaNs ina1 will be consideredequal to NaNs ina2. Default isFalse.

Returns:

Boolean scalar array indicating whether the input arrays are element-wise equal.

Return type:

Array

Examples

>>>jnp.array_equal(jnp.array([1,2,3]),jnp.array([1,2,3]))Array(True, dtype=bool)>>>jnp.array_equal(jnp.array([1,2,3]),jnp.array([1,2]))Array(False, dtype=bool)>>>jnp.array_equal(jnp.array([1,2,3]),jnp.array([1,2,4]))Array(False, dtype=bool)>>>jnp.array_equal(jnp.array([1,2,float('nan')]),...jnp.array([1,2,float('nan')]))Array(False, dtype=bool)>>>jnp.array_equal(jnp.array([1,2,float('nan')]),...jnp.array([1,2,float('nan')]),equal_nan=True)Array(True, dtype=bool)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp