Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.logical_not

Contents

jax.numpy.logical_not#

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

Compute NOT bool(x) element-wise.

JAX implementation ofnumpy.logical_not().

Parameters:

x (ArrayLike) – input array of any dtype.

Returns:

A boolean array that computes NOT bool(x) element-wise

Return type:

Array

See also

Examples

Compute NOT x element-wise on a boolean array:

>>>x=jnp.array([True,False,True])>>>jnp.logical_not(x)Array([False,  True, False], dtype=bool)

For boolean input, this is equivalent toinvert(), which implementsthe unary~ operator:

>>>~xArray([False,  True, False], dtype=bool)

For non-boolean input, the input oflogical_not() is implicitly cast to boolean:

>>>x=jnp.array([-1,0,1])>>>jnp.logical_not(x)Array([False,  True, False], dtype=bool)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp