Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.less

Contents

jax.numpy.less#

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

Return element-wise truth value ofx<y.

JAX implementation ofnumpy.less.

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

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

Returns:

An array containing boolean values.True if the elements ofx<y,andFalse otherwise.

Return type:

Array

See also

Examples

Scalar inputs:

>>>jnp.less(3,7)Array(True, dtype=bool, weak_type=True)

Inputs with same shape:

>>>x=jnp.array([5,9,-3])>>>y=jnp.array([1,6,4])>>>jnp.less(x,y)Array([False, False,  True], dtype=bool)

Inputs with broadcast compatibility:

>>>x1=jnp.array([[2,-4,6,-8],...[-1,5,-3,7]])>>>y1=jnp.array([0,3,-5,9])>>>jnp.less(x1,y1)Array([[False,  True, False,  True],       [ True, False, False,  True]], dtype=bool)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp