dpnp.exp2
- dpnp.exp2(x, /, out=None, *, order='K', where=True, dtype=None, subok=True, **kwargs)[source]
Calculate 2**p for all p in the input array.
For full documentation refer to
numpy.exp2.- Parameters:
x ({dpnp.ndarray, usm_ndarray}) – Input array.
out (({None, dpnp.ndarray, usm_ndarray}, optional):) – Output array to populate. Array must have the correct shape and the expected data type.
order ({"C", "F", "A", "K"}, optional) – Memory layout of the newly output array, if parameter out is
None. Default: “K”.
- Returns:
out – Element-wise 2 to the power x.
- Return type:
dpnp.ndarray
Limitations
Parameters where, dtype and subok are supported with their default values. Keyword argument kwargs is currently unsupported. Otherwise the function will be executed sequentially on CPU.
See also
dpnp.expCalculate exponential for all elements in the array.
dpnp.expm1exp(x) - 1, the inverse ofdpnp.log1p.dpnp.powerFirst array elements raised to powers from second array, element-wise.
Examples
>>> import dpnp as np >>> x = np.arange(3.) >>> np.exp2(x) array([1., 2., 4.])