dpnp.log
- dpnp.log(x, /, out=None, *, order='K', where=True, dtype=None, subok=True, **kwargs)[source]
Natural logarithm, element-wise.
The natural logarithm log is the inverse of the exponential function, so that log(exp(x)) = x. The natural logarithm is logarithm in base e.
For full documentation refer to
numpy.log.- Returns:
out – The natural logarithm of x, element-wise.
- Return type:
dpnp.ndarray
Limitations
Parameters x is only supported as either
dpnp.ndarrayordpctl.tensor.usm_ndarray. Parameters where, dtype and subok are supported with their default values. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types.See also
dpnp.log10Return the base 10 logarithm of the input array, element-wise.
dpnp.log2Base-2 logarithm of x.
dpnp.log1pReturn the natural logarithm of one plus the input array, element-wise.
Examples
>>> import dpnp as np >>> x = np.array([1, np.e, np.e**2, 0]) >>> np.log(x) array([ 0., 1., 2., -inf])