Array API compatible wrapper for :py:func:`np.sign `. See its docstring for more information.
(x: Array, /)
| 661 | |
| 662 | |
| 663 | def sign(x: Array, /) -> Array: |
| 664 | """ |
| 665 | Array API compatible wrapper for :py:func:`np.sign <numpy.sign>`. |
| 666 | |
| 667 | See its docstring for more information. |
| 668 | """ |
| 669 | if x.dtype not in _numeric_dtypes: |
| 670 | raise TypeError("Only numeric dtypes are allowed in sign") |
| 671 | return Array._new(np.sign(x._array)) |
| 672 | |
| 673 | |
| 674 | def sin(x: Array, /) -> Array: |