diff --git a/dpnp/dpnp_algo/dpnp_algo.pxd b/dpnp/dpnp_algo/dpnp_algo.pxd index 1a1136349b56..fad543d202f8 100644 --- a/dpnp/dpnp_algo/dpnp_algo.pxd +++ b/dpnp/dpnp_algo/dpnp_algo.pxd @@ -249,12 +249,32 @@ cdef dpnp_DPNPFuncType_to_dtype(size_t type) """ Bitwise functions """ -cpdef dpnp_descriptor dpnp_bitwise_and(object x1_obj, object x2_obj, object dtype=*, dparray out=*, object where=*) -cpdef dpnp_descriptor dpnp_bitwise_or(object x1_obj, object x2_obj, object dtype=*, dparray out=*, object where=*) -cpdef dpnp_descriptor dpnp_bitwise_xor(object x1_obj, object x2_obj, object dtype=*, dparray out=*, object where=*) +cpdef dpnp_descriptor dpnp_bitwise_and(dpnp_descriptor x1_obj, + dpnp_descriptor x2_obj, + object dtype=*, + dpnp_descriptor out=*, + object where=*) +cpdef dpnp_descriptor dpnp_bitwise_or(dpnp_descriptor x1_obj, + dpnp_descriptor x2_obj, + object dtype=*, + dpnp_descriptor out=*, + object where=*) +cpdef dpnp_descriptor dpnp_bitwise_xor(dpnp_descriptor x1_obj, + dpnp_descriptor x2_obj, + object dtype=*, + dpnp_descriptor out=*, + object where=*) cpdef dpnp_descriptor dpnp_invert(dpnp_descriptor x1) -cpdef dpnp_descriptor dpnp_left_shift(object x1_obj, object x2_obj, object dtype=*, dparray out=*, object where=*) -cpdef dpnp_descriptor dpnp_right_shift(object x1_obj, object x2_obj, object dtype=*, dparray out=*, object where=*) +cpdef dpnp_descriptor dpnp_left_shift(dpnp_descriptor x1_obj, + dpnp_descriptor x2_obj, + object dtype=*, + dpnp_descriptor out=*, + object where=*) +cpdef dpnp_descriptor dpnp_right_shift(dpnp_descriptor x1_obj, + dpnp_descriptor x2_obj, + object dtype=*, + dpnp_descriptor out=*, + object where=*) """ @@ -293,17 +313,27 @@ cpdef dpnp_descriptor dpnp_copy(dpnp_descriptor x1) """ Mathematical functions """ -cpdef dpnp_descriptor dpnp_add(object x1_obj, object x2_obj, object dtype=*, dparray out=*, object where=*) -cpdef dpnp_descriptor dpnp_arctan2(dpnp_descriptor x1_obj, dpnp_descriptor x2_obj, object dtype=*, dparray out=*, object where=*) -cpdef dpnp_descriptor dpnp_divide(object x1_obj, object x2_obj, object dtype=*, dparray out=*, object where=*) -cpdef dpnp_descriptor dpnp_hypot(object x1_obj, object x2_obj, object dtype=*, dparray out=*, object where=*) -cpdef dpnp_descriptor dpnp_maximum(object x1_obj, object x2_obj, object dtype=*, dparray out=*, object where=*) -cpdef dpnp_descriptor dpnp_minimum(object x1_obj, object x2_obj, object dtype=*, dparray out=*, object where=*) -cpdef dpnp_descriptor dpnp_multiply(object x1_obj, object x2_obj, object dtype=*, dparray out=*, object where=*) +cpdef dpnp_descriptor dpnp_add(dpnp_descriptor x1_obj, dpnp_descriptor x2_obj, object dtype=*, + dpnp_descriptor out=*, object where=*) +cpdef dpnp_descriptor dpnp_arctan2(dpnp_descriptor x1_obj, dpnp_descriptor x2_obj, object dtype=*, + dpnp_descriptor out=*, object where=*) +cpdef dpnp_descriptor dpnp_divide(dpnp_descriptor x1_obj, dpnp_descriptor x2_obj, object dtype=*, + dpnp_descriptor out=*, object where=*) +cpdef dpnp_descriptor dpnp_hypot(dpnp_descriptor x1_obj, dpnp_descriptor x2_obj, object dtype=*, + dpnp_descriptor out=*, object where=*) +cpdef dpnp_descriptor dpnp_maximum(dpnp_descriptor x1_obj, dpnp_descriptor x2_obj, object dtype=*, + dpnp_descriptor out=*, object where=*) +cpdef dpnp_descriptor dpnp_minimum(dpnp_descriptor x1_obj, dpnp_descriptor x2_obj, object dtype=*, + dpnp_descriptor out=*, object where=*) +cpdef dpnp_descriptor dpnp_multiply(dpnp_descriptor x1_obj, dpnp_descriptor x2_obj, object dtype=*, + dpnp_descriptor out=*, object where=*) cpdef dpnp_descriptor dpnp_negative(dpnp_descriptor array1) -cpdef dpnp_descriptor dpnp_power(dpnp_descriptor x1_obj, dpnp_descriptor x2_obj, object dtype=*, dparray out=*, object where=*) -cpdef dpnp_descriptor dpnp_remainder(object x1_obj, object x2_obj, object dtype=*, dparray out=*, object where=*) -cpdef dpnp_descriptor dpnp_subtract(object x1_obj, object x2_obj, object dtype=*, dparray out=*, object where=*) +cpdef dpnp_descriptor dpnp_power(dpnp_descriptor x1_obj, dpnp_descriptor x2_obj, object dtype=*, + dpnp_descriptor out=*, object where=*) +cpdef dpnp_descriptor dpnp_remainder(dpnp_descriptor x1_obj, dpnp_descriptor x2_obj, object dtype=*, + dpnp_descriptor out=*, object where=*) +cpdef dpnp_descriptor dpnp_subtract(dpnp_descriptor x1_obj, dpnp_descriptor x2_obj, object dtype=*, + dpnp_descriptor out=*, object where=*) """ diff --git a/dpnp/dpnp_algo/dpnp_algo.pyx b/dpnp/dpnp_algo/dpnp_algo.pyx index b04cdc604298..15395a78a467 100644 --- a/dpnp/dpnp_algo/dpnp_algo.pyx +++ b/dpnp/dpnp_algo/dpnp_algo.pyx @@ -302,7 +302,7 @@ cdef utils.dpnp_descriptor call_fptr_2in_1out(DPNPFuncName fptr_name, utils.dpnp_descriptor x1_obj, utils.dpnp_descriptor x2_obj, object dtype=None, - dparray out=None, + utils.dpnp_descriptor out=None, object where=True, func_name=None): @@ -330,11 +330,19 @@ cdef utils.dpnp_descriptor call_fptr_2in_1out(DPNPFuncName fptr_name, if out.shape != result_shape: utils.checker_throw_value_error(func_name, 'out.shape', out.shape, result_shape) - result = dpnp_descriptor(out) + result = out """ Call FPTR function """ cdef fptr_2in_1out_t func = kernel_data.ptr - func(result.get_data(), x1_obj.get_data(), x1_obj.size, x1_shape.data(), x1_shape.size(), - x2_obj.get_data(), x2_obj.size, x2_shape.data(), x2_shape.size(), NULL) + func(result.get_data(), + x1_obj.get_data(), + x1_obj.size, + x1_shape.data(), + x1_shape.size(), + x2_obj.get_data(), + x2_obj.size, + x2_shape.data(), + x2_shape.size(), + NULL) return result diff --git a/dpnp/dpnp_algo/dpnp_algo_arraycreation.pyx b/dpnp/dpnp_algo/dpnp_algo_arraycreation.pyx index 88a2f633375e..daf79c8330b5 100644 --- a/dpnp/dpnp_algo/dpnp_algo_arraycreation.pyx +++ b/dpnp/dpnp_algo/dpnp_algo_arraycreation.pyx @@ -218,8 +218,6 @@ cpdef object dpnp_logspace(start, stop, num, endpoint, base, dtype, axis): cpdef list dpnp_meshgrid(xi, copy, sparse, indexing): - cdef dparray res_item - input_count = len(xi) # simple case @@ -253,14 +251,15 @@ cpdef list dpnp_meshgrid(xi, copy, sparse, indexing): shape = tuple(shape_list) + cdef utils.dpnp_descriptor res_item result = [] for i in range(input_count): - res_item = utils_py.create_output_descriptor_py(shape, xi[i].dtype, None).get_pyobj() + res_item = utils_py.create_output_descriptor_py(shape, xi[i].dtype, None) for j in range(res_item.size): - res_item[j] = xi[i][(j // steps[i]) % xi[i].size] + res_item.get_pyobj()[j] = xi[i][(j // steps[i]) % xi[i].size] - result.append(res_item) + result.append(res_item.get_pyobj()) return result diff --git a/dpnp/dpnp_algo/dpnp_algo_bitwise.pyx b/dpnp/dpnp_algo/dpnp_algo_bitwise.pyx index 09d42a705e94..1bad7bcc3be3 100644 --- a/dpnp/dpnp_algo/dpnp_algo_bitwise.pyx +++ b/dpnp/dpnp_algo/dpnp_algo_bitwise.pyx @@ -44,24 +44,44 @@ __all__ += [ ] -cpdef utils.dpnp_descriptor dpnp_bitwise_and(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): +cpdef utils.dpnp_descriptor dpnp_bitwise_and(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): return call_fptr_2in_1out(DPNP_FN_BITWISE_AND, x1_obj, x2_obj, dtype=dtype, out=out, where=where) -cpdef utils.dpnp_descriptor dpnp_bitwise_or(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): +cpdef utils.dpnp_descriptor dpnp_bitwise_or(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): return call_fptr_2in_1out(DPNP_FN_BITWISE_OR, x1_obj, x2_obj, dtype=dtype, out=out, where=where) -cpdef utils.dpnp_descriptor dpnp_bitwise_xor(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): +cpdef utils.dpnp_descriptor dpnp_bitwise_xor(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): return call_fptr_2in_1out(DPNP_FN_BITWISE_XOR, x1_obj, x2_obj, dtype=dtype, out=out, where=where) -cpdef utils.dpnp_descriptor dpnp_invert(dpnp_descriptor arr): +cpdef utils.dpnp_descriptor dpnp_invert(utils.dpnp_descriptor arr): return call_fptr_1in_1out(DPNP_FN_INVERT, arr, arr.shape) -cpdef utils.dpnp_descriptor dpnp_left_shift(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): +cpdef utils.dpnp_descriptor dpnp_left_shift(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): return call_fptr_2in_1out(DPNP_FN_LEFT_SHIFT, x1_obj, x2_obj, dtype=dtype, out=out, where=where) -cpdef utils.dpnp_descriptor dpnp_right_shift(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): +cpdef utils.dpnp_descriptor dpnp_right_shift(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): return call_fptr_2in_1out(DPNP_FN_RIGHT_SHIFT, x1_obj, x2_obj, dtype=dtype, out=out, where=where) diff --git a/dpnp/dpnp_algo/dpnp_algo_mathematical.pyx b/dpnp/dpnp_algo/dpnp_algo_mathematical.pyx index cd2346a88d42..0e7e34e84a16 100644 --- a/dpnp/dpnp_algo/dpnp_algo_mathematical.pyx +++ b/dpnp/dpnp_algo/dpnp_algo_mathematical.pyx @@ -101,12 +101,20 @@ cpdef dparray dpnp_absolute(utils.dpnp_descriptor input): return result -cpdef utils.dpnp_descriptor dpnp_add(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_ADD, x1_obj, x2_obj, dtype=dtype, out=out, where=where) +cpdef utils.dpnp_descriptor dpnp_add(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_ADD, x1_obj, x2_obj, dtype, out, where) -cpdef utils.dpnp_descriptor dpnp_arctan2(utils.dpnp_descriptor x1_obj, utils.dpnp_descriptor x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_ARCTAN2, x1_obj, x2_obj, dtype=dtype, out=out, where=where, func_name="arctan2") +cpdef utils.dpnp_descriptor dpnp_arctan2(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_ARCTAN2, x1_obj, x2_obj, dtype, out, where, func_name="arctan2") cpdef dpnp_around(utils.dpnp_descriptor x1, int decimals): @@ -134,12 +142,20 @@ cpdef utils.dpnp_descriptor dpnp_conjugate(utils.dpnp_descriptor x1): return call_fptr_1in_1out(DPNP_FN_CONJIGUATE, x1, x1.shape) -cpdef utils.dpnp_descriptor dpnp_copysign(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_COPYSIGN, x1_obj, x2_obj, dtype=dtype, out=out, where=where) +cpdef utils.dpnp_descriptor dpnp_copysign(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_COPYSIGN, x1_obj, x2_obj, dtype, out, where) -cpdef utils.dpnp_descriptor dpnp_cross(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_CROSS, x1_obj, x2_obj, dtype=dtype, out=out, where=where) +cpdef utils.dpnp_descriptor dpnp_cross(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_CROSS, x1_obj, x2_obj, dtype, out, where) cpdef utils.dpnp_descriptor dpnp_cumprod(utils.dpnp_descriptor x1): @@ -193,8 +209,12 @@ cpdef dparray dpnp_diff(object input, int n): return dpnp.array([], dtype=input.dtype) -cpdef utils.dpnp_descriptor dpnp_divide(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_DIVIDE, x1_obj, x2_obj, dtype=dtype, out=out, where=where) +cpdef utils.dpnp_descriptor dpnp_divide(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_DIVIDE, x1_obj, x2_obj, dtype, out, where) cpdef utils.dpnp_descriptor dpnp_ediff1d(utils.dpnp_descriptor x1): @@ -213,12 +233,20 @@ cpdef utils.dpnp_descriptor dpnp_floor(utils.dpnp_descriptor x1, dparray out): return call_fptr_1in_1out(DPNP_FN_FLOOR, x1, x1.shape, out=out, func_name='floor') -cpdef utils.dpnp_descriptor dpnp_floor_divide(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_FLOOR_DIVIDE, x1_obj, x2_obj, dtype=dtype, out=out, where=where) +cpdef utils.dpnp_descriptor dpnp_floor_divide(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_FLOOR_DIVIDE, x1_obj, x2_obj, dtype, out, where) -cpdef utils.dpnp_descriptor dpnp_fmod(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_FMOD, x1_obj, x2_obj, dtype=dtype, out=out, where=where) +cpdef utils.dpnp_descriptor dpnp_fmod(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_FMOD, x1_obj, x2_obj, dtype, out, where) cpdef dparray dpnp_gradient(object y1, int dx=1): @@ -242,16 +270,28 @@ cpdef dparray dpnp_gradient(object y1, int dx=1): return result -cpdef utils.dpnp_descriptor dpnp_hypot(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_HYPOT, x1_obj, x2_obj, dtype=dtype, out=out, where=where) +cpdef utils.dpnp_descriptor dpnp_hypot(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_HYPOT, x1_obj, x2_obj, dtype, out, where) -cpdef utils.dpnp_descriptor dpnp_maximum(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_MAXIMUM, x1_obj, x2_obj, dtype=dtype, out=out, where=where) +cpdef utils.dpnp_descriptor dpnp_maximum(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_MAXIMUM, x1_obj, x2_obj, dtype, out, where) -cpdef utils.dpnp_descriptor dpnp_minimum(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_MINIMUM, x1_obj, x2_obj, dtype=dtype, out=out, where=where) +cpdef utils.dpnp_descriptor dpnp_minimum(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_MINIMUM, x1_obj, x2_obj, dtype, out, where) cpdef tuple dpnp_modf(utils.dpnp_descriptor x1): @@ -273,8 +313,12 @@ cpdef tuple dpnp_modf(utils.dpnp_descriptor x1): return result1, result2 -cpdef utils.dpnp_descriptor dpnp_multiply(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_MULTIPLY, x1_obj, x2_obj, dtype=dtype, out=out, where=where) +cpdef utils.dpnp_descriptor dpnp_multiply(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_MULTIPLY, x1_obj, x2_obj, dtype, out, where) cpdef utils.dpnp_descriptor dpnp_nancumprod(utils.dpnp_descriptor x1): @@ -337,8 +381,12 @@ cpdef utils.dpnp_descriptor dpnp_negative(dpnp_descriptor x1): return call_fptr_1in_1out(DPNP_FN_NEGATIVE, x1, x1.shape) -cpdef utils.dpnp_descriptor dpnp_power(utils.dpnp_descriptor x1_obj, utils.dpnp_descriptor x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_POWER, x1_obj, x2_obj, dtype=dtype, out=out, where=where, func_name="power") +cpdef utils.dpnp_descriptor dpnp_power(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_POWER, x1_obj, x2_obj, dtype, out, where, func_name="power") cpdef utils.dpnp_descriptor dpnp_prod(utils.dpnp_descriptor input, @@ -379,16 +427,24 @@ cpdef utils.dpnp_descriptor dpnp_prod(utils.dpnp_descriptor input, return result -cpdef utils.dpnp_descriptor dpnp_remainder(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_REMAINDER, x1_obj, x2_obj, dtype=dtype, out=out, where=where) +cpdef utils.dpnp_descriptor dpnp_remainder(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_REMAINDER, x1_obj, x2_obj, dtype, out, where) cpdef utils.dpnp_descriptor dpnp_sign(utils.dpnp_descriptor x1): return call_fptr_1in_1out(DPNP_FN_SIGN, x1, x1.shape) -cpdef utils.dpnp_descriptor dpnp_subtract(object x1_obj, object x2_obj, object dtype=None, dparray out=None, object where=True): - return call_fptr_2in_1out(DPNP_FN_SUBTRACT, x1_obj, x2_obj, dtype=dtype, out=out, where=where) +cpdef utils.dpnp_descriptor dpnp_subtract(utils.dpnp_descriptor x1_obj, + utils.dpnp_descriptor x2_obj, + object dtype=None, + utils.dpnp_descriptor out=None, + object where=True): + return call_fptr_2in_1out(DPNP_FN_SUBTRACT, x1_obj, x2_obj, dtype, out, where) cpdef utils.dpnp_descriptor dpnp_sum(utils.dpnp_descriptor input, diff --git a/dpnp/dpnp_iface_bitwise.py b/dpnp/dpnp_iface_bitwise.py index a84284095f1a..f74b3d6cfd3c 100644 --- a/dpnp/dpnp_iface_bitwise.py +++ b/dpnp/dpnp_iface_bitwise.py @@ -82,8 +82,6 @@ def _check_nd_call(origin_func, dpnp_func, x1, x2, dtype=None, out=None, where=T pass elif x1_desc and x2_desc and x1_desc.shape != x2_desc.shape: pass - elif out is not None and not isinstance(out, dparray): - pass elif dtype is not None: pass elif out is not None: @@ -91,7 +89,8 @@ def _check_nd_call(origin_func, dpnp_func, x1, x2, dtype=None, out=None, where=T elif not where: pass else: - return dpnp_func(x1_desc, x2_desc, dtype=dtype, out=out, where=where).get_pyobj() + out_desc = dpnp.get_dpnp_descriptor(out) if out is not None else None + return dpnp_func(x1_desc, x2_desc, dtype, out_desc, where).get_pyobj() return call_origin(origin_func, x1, x2, dtype=dtype, out=out, where=where, **kwargs) diff --git a/dpnp/dpnp_iface_mathematical.py b/dpnp/dpnp_iface_mathematical.py index 59ab0ee1ccd1..03c5723d79af 100644 --- a/dpnp/dpnp_iface_mathematical.py +++ b/dpnp/dpnp_iface_mathematical.py @@ -1336,14 +1336,13 @@ def power(x1, x2, dtype=None, out=None, where=True, **kwargs): pass elif x2_desc and x2_desc.ndim == 0: pass - elif out is not None and not isinstance(out, dparray): - pass elif dtype is not None: pass elif not where: pass else: - return dpnp_power(x1_desc, x2_desc, dtype=dtype, out=out, where=where).get_pyobj() + out_desc = dpnp.get_dpnp_descriptor(out) if out is not None else None + return dpnp_power(x1_desc, x2_desc, dtype, out_desc, where).get_pyobj() return call_origin(numpy.power, x1, x2, dtype=dtype, out=out, where=where, **kwargs) diff --git a/dpnp/dpnp_iface_trigonometric.py b/dpnp/dpnp_iface_trigonometric.py index 766982e14ce5..65cafd3ae127 100644 --- a/dpnp/dpnp_iface_trigonometric.py +++ b/dpnp/dpnp_iface_trigonometric.py @@ -359,14 +359,13 @@ def arctan2(x1, x2, dtype=None, out=None, where=True, **kwargs): pass elif x2_desc and x2_desc.ndim == 0: pass - elif out is not None and not isinstance(out, dparray): - pass elif dtype is not None: pass elif not where: pass else: - return dpnp_arctan2(x1_desc, x2_desc, dtype=dtype, out=out, where=where).get_pyobj() + out_desc = dpnp.get_dpnp_descriptor(out) if out is not None else None + return dpnp_arctan2(x1_desc, x2_desc, dtype, out_desc, where).get_pyobj() return call_origin(numpy.arctan2, x1, x2, dtype=dtype, out=out, where=where, **kwargs)