Skip to content

Commit 411a2e9

Browse files
committed
address comments
1 parent d974660 commit 411a2e9

File tree

6 files changed

+35
-7
lines changed

6 files changed

+35
-7
lines changed

dpnp/dpnp_algo/dpnp_elementwise_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ def dpnp_logical_xor(x1, x2, out=None, order="K"):
18341834
Default: "K".
18351835
Returns:
18361836
dpnp.ndarray:
1837-
An array containing the element-wise minima. The data type of
1837+
An array containing the element-wise maxima. The data type of
18381838
the returned array is determined by the Type Promotion Rules.
18391839
"""
18401840

@@ -1880,7 +1880,7 @@ def dpnp_maximum(x1, x2, out=None, order="K"):
18801880
Default: "K".
18811881
Returns:
18821882
dpnp.ndarray:
1883-
An array containing the element-wise maxima. The data type of
1883+
An array containing the element-wise minima. The data type of
18841884
the returned array is determined by the Type Promotion Rules.
18851885
"""
18861886

dpnp/dpnp_iface_mathematical.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -995,12 +995,13 @@ def fmax(x1, x2, /, out=None, *, where=True, dtype=None, subok=True, **kwargs):
995995
Parameters `where`, `dtype` and `subok` are supported with their default values.
996996
Keyword argument `kwargs` is currently unsupported.
997997
Otherwise the function will be executed sequentially on CPU.
998-
Input array data types are limited by supported DPNP :ref:`Data types`.
998+
Input array data types are limited by real-valued data types.
999999
10001000
See Also
10011001
--------
1002-
:obj:`dpnp.maximum` : Element-wise maximum of array elements, propagates NaNs..
1002+
:obj:`dpnp.maximum` : Element-wise maximum of array elements, propagates NaNs.
10031003
:obj:`dpnp.fmin` : Element-wise minimum of array elements, ignore NaNs.
1004+
:obj:`dpnp.minimum` : Element-wise minimum of array elements, propagates NaNs.
10041005
:obj:`dpnp.fmod` : Calculate the element-wise remainder of division.
10051006
10061007
Examples
@@ -1099,12 +1100,13 @@ def fmin(x1, x2, /, out=None, *, where=True, dtype=None, subok=True, **kwargs):
10991100
Parameters `where`, `dtype` and `subok` are supported with their default values.
11001101
Keyword argument `kwargs` is currently unsupported.
11011102
Otherwise the function will be executed sequentially on CPU.
1102-
Input array data types are limited by supported DPNP :ref:`Data types`.
1103+
Input array data types are limited by real-valued data types.
11031104
11041105
See Also
11051106
--------
11061107
:obj:`dpnp.minimum` : Element-wise minimum of array elements, propagates NaNs.
11071108
:obj:`dpnp.fmax` : Element-wise maximum of array elements, ignore NaNs.
1109+
:obj:`dpnp.maximum` : Element-wise maximum of array elements, propagates NaNs.
11081110
:obj:`dpnp.fmod` : Calculate the element-wise remainder of division.
11091111
11101112
Examples
@@ -1440,7 +1442,7 @@ def maximum(
14401442
>>> x1 = np.array([np.nan, 0, np.nan])
14411443
>>> x2 = np.array([0, np.nan, np.nan])
14421444
>>> np.maximum(x1, x2)
1443-
array([ nan, nan, nan])
1445+
array([nan, nan, nan])
14441446
14451447
>>> np.maximum(np.array(np.Inf), 1)
14461448
array(inf)
@@ -1519,7 +1521,7 @@ def minimum(
15191521
>>> x1 = np.array([np.nan, 0, np.nan])
15201522
>>> x2 = np.array([0, np.nan, np.nan])
15211523
>>> np.minimum(x1, x2)
1522-
array([ nan, nan, nan])
1524+
array([nan, nan, nan])
15231525
15241526
>>> np.minimum(np.array(-np.Inf), 1)
15251527
array(-inf)

tests/test_mathematical.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,18 @@ def test_copysign(self, dtype, lhs, rhs):
159159
def test_divide(self, dtype, lhs, rhs):
160160
self._test_mathematical("divide", dtype, lhs, rhs)
161161

162+
@pytest.mark.parametrize(
163+
"dtype", get_all_dtypes(no_bool=True, no_complex=True)
164+
)
165+
def test_fmax(self, dtype, lhs, rhs):
166+
self._test_mathematical("fmax", dtype, lhs, rhs, check_type=False)
167+
168+
@pytest.mark.parametrize(
169+
"dtype", get_all_dtypes(no_bool=True, no_complex=True)
170+
)
171+
def test_fmin(self, dtype, lhs, rhs):
172+
self._test_mathematical("fmin", dtype, lhs, rhs, check_type=False)
173+
162174
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
163175
@pytest.mark.parametrize(
164176
"dtype", get_all_dtypes(no_bool=True, no_complex=True)

tests/test_strides.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ def test_strides_reciprocal(dtype, shape):
164164
"add",
165165
"arctan2",
166166
"divide",
167+
"fmax",
168+
"fmin",
167169
"hypot",
168170
"maximum",
169171
"minimum",

tests/test_sycl_queue.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ def test_proj(device):
357357
pytest.param(
358358
"floor_divide", [1.0, 2.0, 3.0, 4.0], [2.5, 2.5, 2.5, 2.5]
359359
),
360+
pytest.param("fmax", [2.0, 3.0, 4.0], [1.0, 5.0, 2.0]),
361+
pytest.param("fmin", [2.0, 3.0, 4.0], [1.0, 5.0, 2.0]),
360362
pytest.param(
361363
"fmod",
362364
[-3.0, -2.0, -1.0, 1.0, 2.0, 3.0],

tests/test_usm_type.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,16 @@ def test_1in_1out(func, data, usm_type):
356356
[[0.0, 1.0, 2.0], [3.0, 4.0, 5.0]],
357357
[[4.0, 4.0], [4.0, 4.0], [4.0, 4.0]],
358358
),
359+
pytest.param(
360+
"fmax",
361+
[[0.0, 1.0, 2.0]],
362+
[[3.0, 4.0, 5.0]],
363+
),
364+
pytest.param(
365+
"fmin",
366+
[[0.0, 1.0, 2.0]],
367+
[[3.0, 4.0, 5.0]],
368+
),
359369
pytest.param(
360370
"maximum",
361371
[[0.0, 1.0, 2.0]],

0 commit comments

Comments
 (0)