Skip to content

Commit 626a53c

Browse files
antonwolfyvtavana
authored andcommitted
mod is an alias of remainder (#1882)
1 parent 9ce3284 commit 626a53c

File tree

1 file changed

+8
-57
lines changed

1 file changed

+8
-57
lines changed

dpnp/dpnp_iface_mathematical.py

Lines changed: 8 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,63 +2245,6 @@ def gradient(f, *varargs, axis=None, edge_order=1):
22452245
)
22462246

22472247

2248-
def mod(
2249-
x1,
2250-
x2,
2251-
/,
2252-
out=None,
2253-
*,
2254-
where=True,
2255-
order="K",
2256-
dtype=None,
2257-
subok=True,
2258-
**kwargs,
2259-
):
2260-
"""
2261-
Compute element-wise remainder of division.
2262-
2263-
For full documentation refer to :obj:`numpy.mod`.
2264-
2265-
Returns
2266-
-------
2267-
out : dpnp.ndarray
2268-
The element-wise remainder of the quotient `floor_divide(x1, x2)`.
2269-
2270-
Limitations
2271-
-----------
2272-
Parameters `x1` and `x2` are supported as either scalar,
2273-
:class:`dpnp.ndarray` or :class:`dpctl.tensor.usm_ndarray`, but both `x1`
2274-
and `x2` can not be scalars at the same time.
2275-
Parameters `where`, `dtype` and `subok` are supported with their default
2276-
values.
2277-
Keyword argument `kwargs` is currently unsupported.
2278-
Otherwise the function will be executed sequentially on CPU.
2279-
Input array data types are limited by supported DPNP :ref:`Data types`.
2280-
2281-
See Also
2282-
--------
2283-
:obj:`dpnp.fmod` : Calculate the element-wise remainder of division
2284-
:obj:`dpnp.remainder` : Remainder complementary to floor_divide.
2285-
:obj:`dpnp.divide` : Standard division.
2286-
2287-
Notes
2288-
-----
2289-
This function works the same as :obj:`dpnp.remainder`.
2290-
2291-
"""
2292-
2293-
return dpnp.remainder(
2294-
x1,
2295-
x2,
2296-
out=out,
2297-
where=where,
2298-
order=order,
2299-
dtype=dtype,
2300-
subok=subok,
2301-
**kwargs,
2302-
)
2303-
2304-
23052248
def modf(x1, **kwargs):
23062249
"""
23072250
Return the fractional and integral parts of an array, element-wise.
@@ -2818,6 +2761,12 @@ def prod(
28182761
:obj:`dpnp.floor_divide` : Compute the largest integer smaller or equal to the division of the inputs.
28192762
:obj:`dpnp.mod` : Calculate the element-wise remainder of division.
28202763
2764+
Notes
2765+
-----
2766+
Returns ``0`` when `x2` is ``0`` and both `x1` and `x2` are (arrays of)
2767+
integers.
2768+
:obj:`dpnp.mod` is an alias of :obj:`dpnp.remainder`.
2769+
28212770
Examples
28222771
--------
28232772
>>> import dpnp as np
@@ -2843,6 +2792,8 @@ def prod(
28432792
binary_inplace_fn=ti._remainder_inplace,
28442793
)
28452794

2795+
mod = remainder
2796+
28462797

28472798
_RINT_DOCSTRING = """
28482799
Rounds each element `x_i` of the input array `x` to

0 commit comments

Comments
 (0)