Skip to content

Commit 3e6530b

Browse files
Remove _check_nd_call in dpnp_iface_mathematical
1 parent 12ab18e commit 3e6530b

File tree

1 file changed

+5
-62
lines changed

1 file changed

+5
-62
lines changed

dpnp/dpnp_iface_mathematical.py

+5-62
Original file line numberDiff line numberDiff line change
@@ -104,63 +104,6 @@
104104
]
105105

106106

107-
def _check_nd_call(
108-
origin_func,
109-
dpnp_func,
110-
x1,
111-
x2,
112-
out=None,
113-
where=True,
114-
order="K",
115-
dtype=None,
116-
subok=True,
117-
**kwargs,
118-
):
119-
"""
120-
Checks arguments and calls a function.
121-
122-
Chooses a common internal elementwise function to call in DPNP based on input arguments
123-
or to fallback on NumPy call if any passed argument is not currently supported.
124-
125-
"""
126-
127-
if kwargs:
128-
pass
129-
elif where is not True:
130-
pass
131-
elif dtype is not None:
132-
pass
133-
elif subok is not True:
134-
pass
135-
elif dpnp.isscalar(x1) and dpnp.isscalar(x2):
136-
# at least either x1 or x2 has to be an array
137-
pass
138-
else:
139-
if order in "afkcAFKC":
140-
order = order.upper()
141-
elif order is None:
142-
order = "K"
143-
else:
144-
raise ValueError(
145-
"order must be one of 'C', 'F', 'A', or 'K' (got '{}')".format(
146-
order
147-
)
148-
)
149-
150-
return dpnp_func(x1, x2, out=out, order=order)
151-
return call_origin(
152-
origin_func,
153-
x1,
154-
x2,
155-
out=out,
156-
where=where,
157-
order=order,
158-
dtype=dtype,
159-
subok=subok,
160-
**kwargs,
161-
)
162-
163-
164107
def abs(*args, **kwargs):
165108
"""
166109
Calculate the absolute value element-wise.
@@ -291,7 +234,7 @@ def add(
291234
292235
"""
293236

294-
return _check_nd_call(
237+
return check_nd_call_func(
295238
numpy.add,
296239
dpnp_add,
297240
x1,
@@ -689,7 +632,7 @@ def divide(
689632
690633
"""
691634

692-
return _check_nd_call(
635+
return check_nd_call_func(
693636
numpy.divide,
694637
dpnp_divide,
695638
x1,
@@ -864,7 +807,7 @@ def floor_divide(
864807
865808
"""
866809

867-
return _check_nd_call(
810+
return check_nd_call_func(
868811
numpy.floor_divide,
869812
dpnp_floor_divide,
870813
x1,
@@ -1256,7 +1199,7 @@ def multiply(
12561199
12571200
"""
12581201

1259-
return _check_nd_call(
1202+
return check_nd_call_func(
12601203
numpy.multiply,
12611204
dpnp_multiply,
12621205
x1,
@@ -1725,7 +1668,7 @@ def subtract(
17251668
17261669
"""
17271670

1728-
return _check_nd_call(
1671+
return check_nd_call_func(
17291672
numpy.subtract,
17301673
dpnp_subtract,
17311674
x1,

0 commit comments

Comments
 (0)