jax.numpy.exp2

jax.numpy.exp2(x)[source]

Calculate 2**p for all p in the input array.

LAX-backend implementation of exp2(). Original docstring below.

exp2(x, /, out=None, *, where=True, casting=’same_kind’, order=’K’, dtype=None, subok=True[, signature, extobj])

Parameters

x (array_like) – Input values.

Returns

out – Element-wise 2 to the power x. This is a scalar if x is a scalar.

Return type

ndarray or scalar

See also

power()

Notes

New in version 1.3.0.

Examples

>>> np.exp2([2, 3])
array([ 4.,  8.])