(self, other)
Substract an array from an array or a scalar from an array.
Substract an array from an array or a scalar from an array.
Substract an array from an array or a scalar from an array .
def __sub__(self, other):
        """Substract an array from an array or a scalar from an array."""

        if isinstance(other, GPUArray):
            result = self._new_like_me(_get_common_dtype(self, other))
            return self._axpbyz(1, other, -1, result)
        else:
            if other == 0:
                return self.copy()
            else:
                # create a new array for the result
                result = self._new_like_me(_get_common_dtype(self, other))
                return self._axpbz(1, -other, result)
def __sub__ ( self , other ) : if isinstance ( other , GPUArray ) : result = self . _new_like_me ( _get_common_dtype ( self , other ) ) return self . _axpbyz ( 1 , other , - 1 , result ) else : if other == 0 : return self . copy ( ) else : # create a new array for the result result = self . _new_like_me ( _get_common_dtype ( self , other ) ) return self . _axpbz ( 1 , - other , result )