-
Notifications
You must be signed in to change notification settings - Fork 54
Closed
Labels
topic: FFTFast Fourier transforms.Fast Fourier transforms.
Milestone
Description
When working on #746 I came to realize one NumPy behavior we've overlooked so far. In a few NumPy APIs, there's an explicit mention about (exact text varies)
Repeated indices in
axesmeans that the inverse transform over that
axis is performed multiple times.
including fft2, ifft2, fftn, ifftn, and irfftn. I would propose to add a clause to explicitly forbid axes containing repeating entries, for two reasons
- Semantics: It is unclear to me what would the semantics be, say with
fftn(..., axes=(2,1,0,1,2)). Is it a 3D FFT (2,1,0) followed by 2D FFT (1,2), or a 2D FFT (2,1) followed by 3D FFT (0,1,2), or something else? From the perspective of a low-level numerical library, it also makes little sense that we offer accelerated routines for this awkward case. - Consistency: AFAIK we've never talked about what happens in such cases, whenever an array API accepts an
axesargument. I've been having a mental model that a validaxesmust contain non-repeating entries. If this anticipation is correct, I would like to call it out, in particular for FFT where there exists a different precedence.
If people dislike an explicit clause, we should at least add a note to state this is implementation defined.
seberg
Metadata
Metadata
Assignees
Labels
topic: FFTFast Fourier transforms.Fast Fourier transforms.