From e2188ede3e85df0ce17670ec0c684e3ad2013251 Mon Sep 17 00:00:00 2001 From: Anton <100830759+antonwolfy@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:17:24 +0100 Subject: [PATCH] Align arguments of true_divide with divide (#1641) --- dpnp/dpnp_iface_mathematical.py | 37 ++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/dpnp/dpnp_iface_mathematical.py b/dpnp/dpnp_iface_mathematical.py index 70cc5e9cbac..f6ca59e6907 100644 --- a/dpnp/dpnp_iface_mathematical.py +++ b/dpnp/dpnp_iface_mathematical.py @@ -254,6 +254,10 @@ def add( Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP :ref:`Data types`. + Notes + ----- + Equivalent to `x1` + `x2` in terms of array broadcasting. + Examples -------- >>> import dpnp as np @@ -784,6 +788,13 @@ def divide( Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP :ref:`Data types`. + Notes + ----- + Equivalent to `x1` / `x2` in terms of array-broadcasting. + + The ``true_divide(x1, x2)`` function is an alias for + ``divide(x1, x2)``. + Examples -------- >>> import dpnp as np @@ -1717,6 +1728,10 @@ def multiply( Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP :ref:`Data types`. + Notes + ----- + Equivalent to `x1` * `x2` in terms of array broadcasting. + Examples -------- >>> import dpnp as np @@ -2685,6 +2700,10 @@ def subtract( Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP :ref:`Data types`. + Notes + ----- + Equivalent to `x1` - `x2` in terms of array broadcasting. + Examples -------- >>> import dpnp as np @@ -2908,23 +2927,7 @@ def trapz(y1, x1=None, dx=1.0, axis=-1): return call_origin(numpy.trapz, y1, x1, dx, axis) -def true_divide(*args, **kwargs): - """ - Provide a true division of the inputs, element-wise. - - For full documentation refer to :obj:`numpy.true_divide`. - - See Also - -------- - :obj:`dpnp.divide` : Standard division. - - Notes - ----- - This function works the same as :obj:`dpnp.divide`. - - """ - - return dpnp.divide(*args, **kwargs) +true_divide = divide def trunc(