Skip to content

Bug fixes #12

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
Jul 19, 2018
Merged

Bug fixes #12

merged 5 commits into from
Jul 19, 2018

Conversation

oleksandr-pavlyk
Copy link
Contributor

This PR fixes #9.

Also fixes an issue where 1D complex fft transforms of identical arrays, on in C-layout, the other in F-layout, would differ:

import numpy as np
import mkl_fft

d_ccont = np.random.randn(2, 3, 2)
assert d_ccont.flags['C'] and not d_ccont.flags['F']
d_fcont = np.asfortranarray(d_ccont)
assert d_fcont.flags['F'] and not d_fcont.flags['C']

assert np.allclose(d_ccont, d_fcont) # data as the same

f1 = mkl_fft.fft(d_ccont)
f2 = mkl_fft.fft(d_fcont)

assert np.allclose(f1, f2) # this used to trip

Added a test to check for this.

@anton-malakhov @tomashek

…ous and F-contiguous arrays of array rank > 2 holding the same data would differ.

The discrepancy comes from attempt to formulate 1D transform over such arrays as a single call to DftiCompute on equidistant vectors.
For this to work, in out-of-place mode, both input and output must both be either C-contiguous or F-contiguous.

Previously the output was always allocated as C-contiguous empty blob.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python 3.6 ImportWarning
3 participants