MCPcopy Create free account
hub / github.com/numpy/numpy / sign

Function sign

numpy/array_api/_elementwise_functions.py:663–671  ·  view source on GitHub ↗

Array API compatible wrapper for :py:func:`np.sign `. See its docstring for more information.

(x: Array, /)

Source from the content-addressed store, hash-verified

661
662
663def 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
674def sin(x: Array, /) -> Array:

Callers 1

svdFunction · 0.85

Calls 1

_newMethod · 0.80

Tested by

no test coverage detected