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

Method __matmul__

numpy/array_api/_array_object.py:638–648  ·  view source on GitHub ↗

Performs the operation __matmul__.

(self: Array, other: Array, /)

Source from the content-addressed store, hash-verified

636 return self.__class__._new(res)
637
638 def __matmul__(self: Array, other: Array, /) -> Array:
639 """
640 Performs the operation __matmul__.
641 """
642 # matmul is not defined for scalars, but without this, we may get
643 # the wrong error message from asarray.
644 other = self._check_allowed_dtypes(other, "numeric", "__matmul__")
645 if other is NotImplemented:
646 return other
647 res = self._array.__matmul__(other._array)
648 return self.__class__._new(res)
649
650 def __mod__(self: Array, other: Union[int, float, Array], /) -> Array:
651 """

Callers 1

test_operatorsFunction · 0.45

Calls 2

_check_allowed_dtypesMethod · 0.95
_newMethod · 0.80

Tested by 1

test_operatorsFunction · 0.36