dpnp.tanh
- dpnp.tanh(x, /, out=None, *, order='K', where=True, dtype=None, subok=True, **kwargs)[source]
Compute hyperbolic tangent element-wise.
For full documentation refer to
numpy.tanh.- Returns:
out – The hyperbolic tangent of each element of x.
- Return type:
dpnp.ndarray
Limitations
Parameter x is only supported as either
dpnp.ndarrayordpctl.tensor.usm_ndarray. 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. Input array data types are limited by supported DPNP Data types.See also
dpnp.arctanhHyperbolic inverse tangent, element-wise.
dpnp.sinhHyperbolic sine, element-wise.
dpnp.coshHyperbolic cosine, element-wise.
dpnp.tanTrigonometric tangent, element-wise.
Examples
>>> import dpnp as np >>> x = np.array([0, -np.pi, np.pi/2, np.pi]) >>> np.tanh(x) array([0.0, -0.996272, 0.917152, 0.996272])