Skip to content

Commit f0d2192

Browse files
authored
Enable complex broadcasting for 10 more functions (#671)
1 parent ff87e16 commit f0d2192

File tree

4 files changed

+4
-44
lines changed

4 files changed

+4
-44
lines changed

dpnp/dpnp_iface_mathematical.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,6 @@ def add(x1, x2, dtype=None, out=None, where=True, **kwargs):
199199
pass
200200
elif x2_is_dparray and x2.ndim == 0:
201201
pass
202-
elif x1_is_dparray and x2_is_dparray and x1.size != x2.size:
203-
pass
204-
elif x1_is_dparray and x2_is_dparray and x1.shape != x2.shape:
205-
pass
206202
elif out is not None and not isinstance(out, dparray):
207203
pass
208204
elif dtype is not None:
@@ -353,10 +349,6 @@ def copysign(x1, x2, dtype=None, out=None, where=True, **kwargs):
353349
pass
354350
elif x2_is_dparray and x2.ndim == 0:
355351
pass
356-
elif x1_is_dparray and x2_is_dparray and x1.size != x2.size:
357-
pass
358-
elif x1_is_dparray and x2_is_dparray and x1.shape != x2.shape:
359-
pass
360352
elif dtype is not None:
361353
pass
362354
elif out is not None:
@@ -558,10 +550,6 @@ def divide(x1, x2, dtype=None, out=None, where=True, **kwargs):
558550
pass
559551
elif x2_is_dparray and x2.ndim == 0:
560552
pass
561-
elif x1_is_dparray and x2_is_dparray and x1.size != x2.size:
562-
pass
563-
elif x1_is_dparray and x2_is_dparray and x1.shape != x2.shape:
564-
pass
565553
elif dtype is not None:
566554
pass
567555
elif out is not None:
@@ -805,10 +793,6 @@ def fmod(x1, x2, dtype=None, out=None, where=True, **kwargs):
805793
pass
806794
elif x2_is_dparray and x2.ndim == 0:
807795
pass
808-
elif x1_is_dparray and x2_is_dparray and x1.size != x2.size:
809-
pass
810-
elif x1_is_dparray and x2_is_dparray and x1.shape != x2.shape:
811-
pass
812796
elif out is not None and not isinstance(out, dparray):
813797
pass
814798
elif dtype is not None:
@@ -907,10 +891,6 @@ def maximum(x1, x2, dtype=None, out=None, where=True, **kwargs):
907891
pass
908892
elif x2_is_dparray and x2.ndim == 0:
909893
pass
910-
elif x1_is_dparray and x2_is_dparray and x1.size != x2.size:
911-
pass
912-
elif x1_is_dparray and x2_is_dparray and x1.shape != x2.shape:
913-
pass
914894
elif dtype is not None:
915895
pass
916896
elif out is not None:
@@ -965,10 +945,6 @@ def minimum(x1, x2, dtype=None, out=None, where=True, **kwargs):
965945
pass
966946
elif x2_is_dparray and x2.ndim == 0:
967947
pass
968-
elif x1_is_dparray and x2_is_dparray and x1.size != x2.size:
969-
pass
970-
elif x1_is_dparray and x2_is_dparray and x1.shape != x2.shape:
971-
pass
972948
elif dtype is not None:
973949
pass
974950
elif out is not None:
@@ -1299,10 +1275,6 @@ def power(x1, x2, dtype=None, out=None, where=True, **kwargs):
12991275
pass
13001276
elif x2_is_dparray and x2.ndim == 0:
13011277
pass
1302-
elif x1_is_dparray and x2_is_dparray and x1.size != x2.size:
1303-
pass
1304-
elif x1_is_dparray and x2_is_dparray and x1.shape != x2.shape:
1305-
pass
13061278
elif out is not None and not isinstance(out, dparray):
13071279
pass
13081280
elif dtype is not None:
@@ -1482,10 +1454,6 @@ def subtract(x1, x2, dtype=None, out=None, where=True, **kwargs):
14821454
pass
14831455
elif x2_is_dparray and x2.dtype == numpy.bool:
14841456
pass
1485-
elif x1_is_dparray and x2_is_dparray and x1.size != x2.size:
1486-
pass
1487-
elif x1_is_dparray and x2_is_dparray and x1.shape != x2.shape:
1488-
pass
14891457
elif dtype is not None:
14901458
pass
14911459
elif out is not None:

dpnp/dpnp_iface_trigonometric.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,6 @@ def arctan2(x1, x2, dtype=None, out=None, where=True, **kwargs):
368368
pass
369369
elif x2_is_dparray and x2.ndim == 0:
370370
pass
371-
elif x1_is_dparray and x2_is_dparray and x1.size != x2.size:
372-
pass
373-
elif x1_is_dparray and x2_is_dparray and x1.shape != x2.shape:
374-
pass
375371
elif out is not None and not isinstance(out, dparray):
376372
pass
377373
elif dtype is not None:
@@ -642,10 +638,6 @@ def hypot(x1, x2, dtype=None, out=None, where=True, **kwargs):
642638
pass
643639
elif x2_is_dparray and x2.ndim == 0:
644640
pass
645-
elif x1_is_dparray and x2_is_dparray and x1.size != x2.size:
646-
pass
647-
elif x1_is_dparray and x2_is_dparray and x1.shape != x2.shape:
648-
pass
649641
elif out is not None and not isinstance(out, dparray):
650642
pass
651643
elif dtype is not None:

tests/test_bitwise.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import numpy
66

77

8-
@pytest.mark.parametrize("lhs", [[-3, -2, -1, 0, 1, 2, 3], 0])
9-
@pytest.mark.parametrize("rhs", [[0, 1, 2, 3, 4, 5, 6], 3])
8+
@pytest.mark.parametrize("lhs", [[[-7, -6, -5, -4, -3, -2, -1], [0, 1, 2, 3, 4, 5, 6]], [-3, -2, -1, 0, 1, 2, 3], 0])
9+
@pytest.mark.parametrize("rhs", [[[0, 1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12, 13]], [0, 1, 2, 3, 4, 5, 6], 3])
1010
@pytest.mark.parametrize("dtype", [numpy.int32, numpy.int64])
1111
class TestBitwise:
1212

tests/test_mathematical.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def test_multiply_dtype(dtype1, dtype2, data):
6767
numpy.testing.assert_array_equal(result, expected)
6868

6969

70-
@pytest.mark.parametrize("rhs", [[2.0, 1.5, 1.0], 3, 0.3])
71-
@pytest.mark.parametrize("lhs", [[1.3, 2.6, 3.9], 5, 0.5])
70+
@pytest.mark.parametrize("rhs", [[[1, 2, 3], [4, 5, 6]], [2.0, 1.5, 1.0], 3, 0.3])
71+
@pytest.mark.parametrize("lhs", [[[6, 5, 4], [3, 2, 1]], [1.3, 2.6, 3.9], 5, 0.5])
7272
@pytest.mark.parametrize("dtype", [numpy.int32, numpy.int64, numpy.float32, numpy.float64])
7373
class TestMathematical:
7474

0 commit comments

Comments
 (0)