(self, other)
Add an array with an array or an array with a scalar.
Add an array with an array or an array with a scalar.
Add an array with an array or an array with a scalar .
def __add__(self, other):
        """Add an array with an array or an array with a scalar."""

        if isinstance(other, GPUArray):
            # add another vector
            result = self._new_like_me(_get_common_dtype(self, other))
            return self._axpbyz(1, other, 1, result)
        else:
            # add a scalar
            if other == 0:
                return self.copy()
            else:
                result = self._new_like_me(_get_common_dtype(self, other))
                return self._axpbz(1, other, result)
def __add__ ( self , other ) : if isinstance ( other , GPUArray ) : # add another vector result = self . _new_like_me ( _get_common_dtype ( self , other ) ) return self . _axpbyz ( 1 , other , 1 , result ) else : # add a scalar if other == 0 : return self . copy ( ) else : result = self . _new_like_me ( _get_common_dtype ( self , other ) ) return self . _axpbz ( 1 , other , result )