Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.positive

Contents

jax.numpy.positive#

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

Return element-wise positive values of the input.

JAX implementation ofnumpy.positive.

Parameters:

x (ArrayLike) – input array or scalar

Returns:

An array of same shape and dtype asx containing+x.

Return type:

Array

Note

jnp.positive is equivalent tox.copy() and is defined only for thetypes that support arithmetic operations.

See also

Examples

For real-valued inputs:

>>>x=jnp.array([-5,4,7.,-9.5])>>>jnp.positive(x)Array([-5. ,  4. ,  7. , -9.5], dtype=float32)>>>x.copy()Array([-5. ,  4. ,  7. , -9.5], dtype=float32)

For complex inputs:

>>>x1=jnp.array([1-2j,-3+4j,5-6j])>>>jnp.positive(x1)Array([ 1.-2.j, -3.+4.j,  5.-6.j], dtype=complex64)>>>x1.copy()Array([ 1.-2.j, -3.+4.j,  5.-6.j], dtype=complex64)

For uint32:

>>>x2=jnp.array([6,0,-4]).astype(jnp.uint32)>>>x2Array([         6,          0, 4294967292], dtype=uint32)>>>jnp.positive(x2)Array([         6,          0, 4294967292], dtype=uint32)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp