Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.fabs

Contents

jax.numpy.fabs#

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

Compute the element-wise absolute values of the real-valued input.

JAX implementation ofnumpy.fabs.

Parameters:

x (ArrayLike) – input array or scalar. Must not have a complex dtype.

Returns:

An array with same shape asx and dtype float, containing the element-wiseabsolute values.

Return type:

Array

See also

Examples

For integer inputs:

>>>x=jnp.array([-5,-9,1,10,15])>>>jnp.fabs(x)Array([ 5.,  9.,  1., 10., 15.], dtype=float32)

For float type inputs:

>>>x1=jnp.array([-1.342,5.649,3.927])>>>jnp.fabs(x1)Array([1.342, 5.649, 3.927], dtype=float32)

For boolean inputs:

>>>x2=jnp.array([True,False])>>>jnp.fabs(x2)Array([1., 0.], dtype=float32)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp