def logical_and(x1: ndarray, x2: ndarray): new_af_array \ = _binary_func(x1._af_array, x2._af_array, backend.get().af_and) return ndarray(new_af_array)
def _as_str(self, dims: bool = True): arr_str = c_char_ptr_t(0) be = backend.get() safe_call(be.af_array_to_string(c_pointer(arr_str), "", self.arr, 4, dims)) py_str = to_str(arr_str) safe_call(be.af_free_host(arr_str)) return py_str
def mod(x1: ndarray, x2: ndarray): """ Return element-wise remainder of division. """ # return _binary_function(a, b, af.rem) new_af_array \ = _arith_binary_func(x1._af_array, x2._af_array, backend.get().af_mod) return ndarray(new_af_array)
def bitwise_xor(x1: ndarray, x2: ndarray): new_af_array \ = _binary_func(x1._af_array, x2._af_array, backend.get().af_bitxor) return ndarray(new_af_array)
def invert(x: ndarray): if not isinteger(x): raise TypeError("invert only supportd integers arguments") af_array = x._af_array return ndarray(_binary_func(af_array, -1, backend.get().af_bitxor))
def logical_not(x: ndarray): new_af_array = _arith_unary_func(x._af_array, backend.get().af_not) return ndarray(new_af_array)