Array API compatible wrapper for :py:func:`np.tanh `. See its docstring for more information.
(x: Array, /)
| 741 | |
| 742 | |
| 743 | def tanh(x: Array, /) -> Array: |
| 744 | """ |
| 745 | Array API compatible wrapper for :py:func:`np.tanh <numpy.tanh>`. |
| 746 | |
| 747 | See its docstring for more information. |
| 748 | """ |
| 749 | if x.dtype not in _floating_dtypes: |
| 750 | raise TypeError("Only floating-point dtypes are allowed in tanh") |
| 751 | return Array._new(np.tanh(x._array)) |
| 752 | |
| 753 | |
| 754 | def trunc(x: Array, /) -> Array: |