Skip to content
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

Handling arrays with array.shape[i] == 0 #46

Closed
JesseLivezey opened this issue Jan 6, 2020 · 1 comment
Closed

Handling arrays with array.shape[i] == 0 #46

JesseLivezey opened this issue Jan 6, 2020 · 1 comment

Comments

@JesseLivezey
Copy link

When (accidentally) calling fft on an array with one dimension having shape=0, mkl_fft gives a somewhat cryptic error wheras numpy.fft.fft (with no mkl) returns a sensibly shaped array.

with numpy from conda (uses mkl_fft)

import numpy as np
from numpy.fft import fft

fft(np.zeros((10, 0, 5)))
# ValueError: Internal error occurred: b'Intel MKL DFTI ERROR: Inconsistent configuration parameters'

with numpy from pip

import numpy as np
from numpy.fft import fft

fft(np.zeros((10, 0, 5)))
# array([], shape=(10, 0, 5), dtype=complex128)

Conda list

# packages in environment at /home/jesse/anaconda3/envs/fft_test:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
blas                      1.0                         mkl  
ca-certificates           2019.11.27                    0  
certifi                   2019.11.28               py38_0  
intel-openmp              2019.4                      243  
libedit                   3.1.20181209         hc058e9b_0  
libffi                    3.2.1                hd88cf55_4  
libgcc-ng                 9.1.0                hdf63c60_0  
libgfortran-ng            7.3.0                hdf63c60_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
mkl                       2019.4                      243  
mkl-service               2.3.0            py38he904b0f_0  
mkl_fft                   1.0.15           py38ha843d7b_0  
mkl_random                1.1.0            py38h962f231_0  
ncurses                   6.1                  he6710b0_1  
numpy                     1.17.4           py38hc1035e2_0  
numpy-base                1.17.4           py38hde5b4d6_0  
openssl                   1.1.1d               h7b6447c_3  
pip                       19.3.1                   py38_0  
python                    3.8.0                h0371630_2  
readline                  7.0                  h7b6447c_5  
setuptools                44.0.0                   py38_0  
six                       1.13.0                   py38_0  
sqlite                    3.30.1               h7b6447c_0  
tk                        8.6.8                hbc83047_0  
wheel                     0.33.6                   py38_0  
xz                        5.2.4                h14c3975_4  
zlib                      1.2.11               h7b6447c_3  

Similar things happen for rfft, fft2, etc.

@oleksandr-pavlyk
Copy link
Collaborator

This has been addressed in commits of PR #45:

In [1]: import mkl_fft, numpy as np

In [2]: mkl_fft.fft(np.ones((10,0,5), dtype='d'))
Out[2]: array([], shape=(10, 0, 5), dtype=complex128)

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

No branches or pull requests

2 participants