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

jax.numpy.float_power — JAX documentation

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

Calculate element-wise base x exponential of y.

JAX implementation of numpy.float_power.

Parameters:
  • x (ArrayLike) – scalar or array. Specifies the bases.

  • y (ArrayLike) – scalar or array. Specifies the exponents. x and y should either have same shape or be broadcast compatible.

Returns:

An array containing the base x exponentials of y, promoting to the inexact dtype.

Return type:

Array

Examples

Inputs with same shape:

>>> x = jnp.array([3, 1, -5])
>>> y = jnp.array([2, 4, -1])
>>> jnp.float_power(x, y)
Array([ 9. ,  1. , -0.2], dtype=float32)

Inputs with broadcast compatibility:

>>> x1 = jnp.array([[2, -4, 1],
...                 [-1, 2, 3]])
>>> y1 = jnp.array([-2, 1, 4])
>>> jnp.float_power(x1, y1)
Array([[ 0.25, -4.  ,  1.  ],
       [ 1.  ,  2.  , 81.  ]], dtype=float32)

jnp.float_power produces nan for negative values raised to a non-integer values.

>>> jnp.float_power(-3, 1.7)
Array(nan, dtype=float32, weak_type=True)

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