jax.numpy.float_power
Contents
jax.numpy.float_power#
- jax.numpy.float_power(x,y,/)[source]#
Calculate element-wise base
xexponential ofy.JAX implementation of
numpy.float_power.- Parameters:
x (ArrayLike) – scalar or array. Specifies the bases.
y (ArrayLike) – scalar or array. Specifies the exponents.
xandyshould eitherhave same shape or be broadcast compatible.
- Returns:
An array containing the base
xexponentials ofy, promoting to theinexact dtype.- Return type:
See also
jax.numpy.exp(): Calculates element-wise exponential of the input.jax.numpy.exp2(): Calculates base-2 exponential of each element ofthe input.
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_powerproducesnanfor negative values raised to a non-integervalues.>>>jnp.float_power(-3,1.7)Array(nan, dtype=float32, weak_type=True)
Contents
