Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.absolute

Contents

jax.numpy.absolute#

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

Calculate the absolute value element-wise.

JAX implementation ofnumpy.absolute.

This is the same function asjax.numpy.abs().

Parameters:

x (ArrayLike) – Input array

Returns:

An array-like object containing the absolute value of each element inx,with the same shape asx. For complex valued input,\(a + ib\),the absolute value is\(\sqrt{a^2+b^2}\).

Return type:

Array

Examples

>>>x1=jnp.array([5,-2,0,12])>>>jnp.absolute(x1)Array([ 5,  2,  0, 12], dtype=int32)
>>>x2=jnp.array([[8,-3,1],[0,9,-6]])>>>jnp.absolute(x2)Array([[8, 3, 1],       [0, 9, 6]], dtype=int32)
>>>x3=jnp.array([8+15j,3-4j,-5+0j])>>>jnp.absolute(x3)Array([17.,  5.,  5.], dtype=float32)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp