Skip to content

update the test suite for dpnp.fft module #2071

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

Merged
merged 5 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

### Change
### Changed

### Fixed

Expand Down Expand Up @@ -50,7 +50,7 @@ In addition, this release completes implementation of `dpnp.fft` module and adds
* Added implementation of `dpnp.resize` and `dpnp.rot90` functions [#2030](https://github.com/IntelPython/dpnp/pull/2030)
* Added implementation of `dpnp.require` function [#2036](https://github.com/IntelPython/dpnp/pull/2036)

### Change
### Changed

* Extended pre-commit pylint check to `dpnp.fft` module [#1860](https://github.com/IntelPython/dpnp/pull/1860)
* Reworked `vm` vector math backend to reuse `dpctl.tensor` functions around unary and binary functions [#1868](https://github.com/IntelPython/dpnp/pull/1868)
Expand Down Expand Up @@ -114,6 +114,7 @@ In addition, this release completes implementation of `dpnp.fft` module and adds
* Updated `dpnp.fft` backend to depend on `INTEL_MKL_VERSION` flag to ensures that the appropriate code segment is executed based on the version of OneMKL [#2035](https://github.com/IntelPython/dpnp/pull/2035)
* Use `dpctl::tensor::alloc_utils::sycl_free_noexcept` instead of `sycl::free` in `host_task` tasks associated with life-time management of temporary USM allocations [#2058](https://github.com/IntelPython/dpnp/pull/2058)
* Improved implementation of `dpnp.kron` to avoid unnecessary copy for non-contiguous arrays [#2059](https://github.com/IntelPython/dpnp/pull/2059)
* Updated the test suit for `dpnp.fft` module [#2071](https://github.com/IntelPython/dpnp/pull/2071)

### Fixed

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ exclude-protected = ["_create_from_usm_ndarray"]

[tool.pylint.design]
max-args = 11
max-positional-arguments = 9
max-locals = 30
max-branches = 15
max-returns = 8
Expand Down
7 changes: 5 additions & 2 deletions tests/test_fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,13 @@ def test_fftn_out(self, axes, s):
assert_dtype_allclose(iresult, iexpected, check_only_type_kind=True)

def test_negative_s(self):
# stock NumPy 2.0, if s is -1, the whole input is used (no padding/trimming).
a_np = numpy.empty((3, 4, 5), dtype=numpy.complex64)
x1 = numpy.random.uniform(-10, 10, 60)
x2 = numpy.random.uniform(-10, 10, 60)
a_np = numpy.array(x1 + 1j * x2, dtype=numpy.complex64).reshape(3, 4, 5)
a = dpnp.array(a_np)

# For dpnp and stock NumPy 2.0, if s is -1, the whole input is used
# (no padding or trimming).
result = dpnp.fft.fftn(a, s=(-1, -1), axes=(0, 2))
expected = numpy.fft.fftn(a_np, s=(3, 5), axes=(0, 2))
assert_dtype_allclose(result, expected, check_only_type_kind=True)
Expand Down
Loading