def __rpow__(self, other): if(isinstance(other, numbers.Number) and numpy.issubdtype(type(other), numpy.float) and numpy.issubdtype(self.dtype, numpy.integer)): # AF does not automatically upconvert A**0.5 to float for integer arrays s = arrayfire.pow(pu.raw(other), self.astype(type(other)).d_array) else: s = arrayfire.pow(pu.raw(other), self.d_array) return ndarray(self.shape, dtype=pu.typemap(s.dtype()), af_array=s)
def __ne__(self, other): if(other is None): return True s = self.d_array != pu.raw(other) return ndarray(self.shape, dtype=numpy.bool, af_array=s)
def __eq__(self, other): if(other is None): return False s = self.d_array == pu.raw(other) return ndarray(self.shape, dtype=numpy.bool, af_array=s)
def __ge__(self, other): s = self.d_array >= pu.raw(other) return ndarray(self.shape, dtype=numpy.bool, af_array=s)
def __rdiv__(self, other): s = pu.raw(other) / self.d_array return ndarray(self.shape, dtype=pu.typemap(s.dtype()), af_array=s)
def __idiv__(self, other): afnumpy.divide(self, pu.raw(other), out=self) return self
def __imul__(self, other): afnumpy.multiply(self, pu.raw(other), out=self) return self
def __mul__(self, other): s = self.d_array * pu.raw(other) return ndarray(self.shape, dtype=pu.typemap(s.dtype()), af_array=s)
def __isub__(self, other): afnumpy.subtract(self, pu.raw(other), out=self) return self
def __iadd__(self, other): self[:] = self[:] + pu.raw(other) return self