A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.jax.dev/en/latest/_autosummary/jax.numpy.absolute.html below:

jax.numpy.absolute — JAX documentation

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

Calculate the absolute value element-wise.

JAX implementation of numpy.absolute.

This is the same function as jax.numpy.abs().

Parameters:

x (ArrayLike) – Input array

Returns:

An array-like object containing the absolute value of each element in x, with the same shape as x. 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)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4