Skip to content

Commit fad2bfa

Browse files
Update _call_func_cupy and remove resolve_special_scp
1 parent 42f4846 commit fad2bfa

File tree

3 files changed

+1
-21
lines changed

3 files changed

+1
-21
lines changed

dpnp/tests/third_party/cupy/testing/_loops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def _call_func_cupy(impl, args, kw, name, sp_name, scipy_name):
7171
if sp_name:
7272
kw[sp_name] = cupyx.scipy.sparse
7373
if scipy_name:
74-
kw[scipy_name] = cupy
74+
kw[scipy_name] = cupy.scipy
7575
kw[name] = cupy
7676
result, error = _call_func(impl, args, kw)
7777
return result, error

dpnp/tests/third_party/cupyx/scipy_tests/linalg_tests/test_decomp_lu.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def test_lu_factor(self, dtype):
4949
a_cpu = testing.shaped_random(self.shape, numpy, dtype=dtype)
5050
a_gpu = cupy.asarray(a_cpu)
5151
result_cpu = scipy.linalg.lu_factor(a_cpu)
52-
# Originally used cupyx.scipy.linalg.lu_factor
5352
result_gpu = cupy.scipy.linalg.lu_factor(a_gpu)
5453
assert len(result_cpu) == len(result_gpu)
5554
assert result_cpu[0].dtype == result_gpu[0].dtype
@@ -177,8 +176,6 @@ def test_lu_solve(self, xp, scp, dtype):
177176
a_shape, b_shape = self.shapes
178177
A = testing.shaped_random(a_shape, xp, dtype=dtype)
179178
b = testing.shaped_random(b_shape, xp, dtype=dtype)
180-
if scp == cupy:
181-
scp = cupy.scipy
182179
lu = scp.linalg.lu_factor(A)
183180
return scp.linalg.lu_solve(lu, b, trans=self.trans)
184181

dpnp/tests/third_party/cupyx/scipy_tests/special_tests/test_erf.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import unittest
4-
from functools import wraps
54

65
import numpy
76
import pytest
@@ -17,19 +16,6 @@ def _boundary_inputs(boundary, rtol, atol):
1716
return [left, boundary, right]
1817

1918

20-
# Ensure `scp` exposes `.special` submodule:
21-
# use `dpnp.scipy` for DPNP, `scipy` for SciPy
22-
def resolve_special_scp(func):
23-
@wraps(func)
24-
def wrapper(*args, **kwargs):
25-
scp = kwargs.get("scp")
26-
if scp is not None and not hasattr(scp, "special"):
27-
kwargs["scp"] = getattr(scp, "scipy", scp) # dpnp -> dpnp.scipy
28-
return func(*args, **kwargs)
29-
30-
return wrapper
31-
32-
3319
@testing.with_requires("scipy")
3420
class _TestBase:
3521

@@ -67,7 +53,6 @@ class TestSpecial(unittest.TestCase, _TestBase):
6753
# scipy>=1.16: 'e -> d', which causes type_check=False
6854
@testing.for_dtypes(["e", "f", "d"])
6955
@testing.numpy_cupy_allclose(atol=1e-5, scipy_name="scp", type_check=False)
70-
@resolve_special_scp
7156
def check_unary(self, name, xp, scp, dtype):
7257
import scipy.special
7358

@@ -76,7 +61,6 @@ def check_unary(self, name, xp, scp, dtype):
7661

7762
@testing.for_dtypes(["f", "d"])
7863
@testing.numpy_cupy_allclose(atol=1e-5, scipy_name="scp")
79-
@resolve_special_scp
8064
def check_unary_random(self, name, xp, scp, dtype, scale, offset):
8165
import scipy.special
8266

@@ -85,7 +69,6 @@ def check_unary_random(self, name, xp, scp, dtype, scale, offset):
8569

8670
@testing.for_dtypes(["f", "d"])
8771
@testing.numpy_cupy_allclose(atol=1e-5, scipy_name="scp")
88-
@resolve_special_scp
8972
def check_unary_boundary(self, name, xp, scp, dtype, boundary):
9073
import scipy.special
9174

0 commit comments

Comments
 (0)