`cupyx.scipy.fft` is not compatible with `scipy.fft`
See original GitHub issueIn SciPy, scipy.fft
is accessible after importing scipy
.
$ python -c 'import scipy; print(scipy.fft)'
<module 'scipy.fft' from '/home/niboshi/.pyenv/versions/3.8.0/lib/python3.8/site-packages/scipy/fft/__init__.py'>
cupyx.scipy.fft
is not accessible after importing cupyx.scipy
.
$ python -c 'import cupyx.scipy; print(cupyx.scipy.fft)'
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: module 'cupyx.scipy' has no attribute 'fft'
(What follows is the initial version of this post, where I used an old version of SciPy (1.3.3) and it doesn’t apply to the newest one).
In SciPy,
scipy.fft
is accessible after importingscipy
and is a function.$ python -c 'import scipy; print(scipy.fft)' <function fft at 0x7fab290c95e0>
cupyx.scipy.fft
is not accessible after importingcupyx.scipy
.$ python -c 'import cupyx.scipy; print(cupyx.scipy.fft)' Traceback (most recent call last): File "<string>", line 1, in <module> AttributeError: module 'cupyx.scipy' has no attribute 'fft'
Further, it’s not a function. You have to spell out as
cupyx.scipy.fft.fft
.$ python -c 'import cupyx.scipy.fft; print(cupyx.scipy.fft)' <module 'cupyx.scipy.fft' from '/data2/work/w/repos/cupy/cupyx/scipy/fft/__init__.py'> $ python -c 'import cupyx.scipy.fft; print(cupyx.scipy.fft.fft)' <function fft at 0x7f4787ea91f0>
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Discrete Fourier transforms (cupyx.scipy.fft) — CuPy 11.4.0 ...
fft : when it is set to True , the input array x can (not will) be overwritten arbitrarily. For this reason, when...
Read more >CuPy Documentation - Read the Docs
CuPy covers the full Fast Fourier Transform (FFT) functionalities provided in NumPy (cupy.fft) and a subset in. SciPy (cupyx.scipy.fft).
Read more >scipy.fft.fft — SciPy v1.9.3 Manual
Compute the 1-D discrete Fourier Transform. This function computes the 1-D n-point discrete Fourier Transform (DFT) with the efficient Fast Fourier Transform ( ......
Read more >CuPy v11 is now available - Medium
Previously, CuPy provided binary packages for all supported CUDA releases; cupy-cuda112 for CUDA ... cupyx.scipy.fft.ifhtcupyx.scipy.spatial.distance_matrix
Read more >Python Examples of scipy.fft - ProgramCreek.com
The following are 29 code examples of scipy.fft(). ... the contents of ``x`` can be destroyed. plan (None): This argument is currently not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This function
scipy.fft
is justnumpy.fft.fft
. There are a number of other NumPy functions that get imported into the root SciPy namespace as well, but all of them have recently been deprecated: https://github.com/scipy/scipy/pull/10290.We would like to remove all of them as it is odd to provide functions from a separate library in the public API. Most of them may not be removed for some time, but the current plan is to remove
scipy.fft
from 1.5 so we don’t have this weird hack where there is both a function and module with the same name!https://github.com/scipy/scipy/issues/11264#issuecomment-568426924
Closing as it’s confirmed we don’t have to follow SciPy’s behavior.