-
Notifications
You must be signed in to change notification settings - Fork 21
Implement dpnp.interp()
#2417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Implement dpnp.interp()
#2417
Conversation
Array API standard conformance tests for dpnp=0.18.0dev1=py312he4f9c94_62 ran successfully. |
View rendered docs @ https://intelpython.github.io/dpnp/pull/2417/index.html |
dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp
Outdated
Show resolved
Hide resolved
dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp
Outdated
Show resolved
Hide resolved
dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp
Outdated
Show resolved
Hide resolved
dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp
Outdated
Show resolved
Hide resolved
dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp
Outdated
Show resolved
Hide resolved
dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp
Outdated
Show resolved
Hide resolved
dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp
Outdated
Show resolved
Hide resolved
dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp
Outdated
Show resolved
Hide resolved
dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp
Outdated
Show resolved
Hide resolved
fp = dpnp.array([]) | ||
assert_raises(ValueError, dpnp.interp, x, xp, fp) | ||
|
||
# x complex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any test that xp
can't be complex?
@@ -1143,6 +1143,152 @@ def test_complex(self, xp): | |||
assert_raises((ValueError, TypeError), xp.i0, a) | |||
|
|||
|
|||
class TestInterp: | |||
@pytest.mark.parametrize( | |||
"dtype_x", get_all_dtypes(no_bool=True, no_complex=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have tests with bool inputs?
) | ||
@pytest.mark.parametrize("dtype_y", get_all_dtypes(no_bool=True)) | ||
def test_all_dtypes(self, dtype_x, dtype_y): | ||
x = numpy.linspace(0.1, 9.9, 20).astype(dtype_x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any test where x
and xp
have different dtypes?
@@ -1143,6 +1143,152 @@ def test_complex(self, xp): | |||
assert_raises((ValueError, TypeError), xp.i0, a) | |||
|
|||
|
|||
class TestInterp: | |||
@pytest.mark.parametrize( | |||
"dtype_x", get_all_dtypes(no_bool=True, no_complex=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"dtype_x", get_all_dtypes(no_bool=True, no_complex=True) | |
"dtype_x", get_all_dtypes(no_bool=True, no_complex=True, no_none=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to test None
dtype here and after.
@pytest.mark.parametrize( | ||
"dtype_x", get_all_dtypes(no_bool=True, no_complex=True) | ||
) | ||
@pytest.mark.parametrize("dtype_y", get_all_dtypes(no_bool=True)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a test with bool fp
array?
This PR suggests adding an implementation of
dpnp.interp()
with sycl_kernel including support for all function arguments.