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.fabs.html below:

jax.numpy.fabs — JAX documentation

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

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

JAX implementation of numpy.fabs.

Parameters:

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

Returns:

An array with same shape as x and dtype float, containing the element-wise absolute 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)

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