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

Method __neg__

numpy/array_api/_array_object.py:683–690  ·  view source on GitHub ↗

Performs the operation __neg__.

(self: Array, /)

Source from the content-addressed store, hash-verified

681 return self.__class__._new(res)
682
683 def __neg__(self: Array, /) -> Array:
684 """
685 Performs the operation __neg__.
686 """
687 if self.dtype not in _numeric_dtypes:
688 raise TypeError("Only numeric dtypes are allowed in __neg__")
689 res = self._array.__neg__()
690 return self.__class__._new(res)
691
692 def __or__(self: Array, other: Union[int, bool, Array], /) -> Array:
693 """

Callers

nothing calls this directly

Calls 1

_newMethod · 0.80

Tested by

no test coverage detected