Fix fft when any of the input dimensions is not aligned#6118
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
Addressed @ezyang 's comments. I still couldn't believe that this is my first experience with |
6d60b71 to
8c80373
Compare
|
@pytorchbot retest this please |
1 similar comment
|
@pytorchbot retest this please |
…d test for ifft+fft
…n (should be advanced data layout rather than base_istride)
|
@pytorchbot retest this please |
|
@pytorchbot retest this please |
1 similar comment
|
@pytorchbot retest this please |
| // | ||
| // input[x, y, z] = input[((x * inembed[1] + y) * inembed[2] + z)] | ||
| // | ||
| // Above is the simplified the formulate ignoring the batch dimension. In fact, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| // X[m, \omega] = X[m, N - \omega]*. We return only the first floor(N / 2) + 1 | ||
| // values by default (onesided=True). This is also the assumption in libraries | ||
| // including cuFFT and MKL. | ||
| // [ NOTE ] Fourier Transform Congjugate Symmetry |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
* change irfft signal_sizes arg to be the last * add docs for fft, ifft, rfft, irfft; update doc for stft * fix typo in window function docs * improve gradcheck error message * implement backward of fft, ifft, rfft, irfft * add grad tests for fft, ifft, rfft, irfft * fix nits and typos from #6118 * address comments
* fix fft when any of the input dimensions is not like complex type; add test for ifft+fft * clarify the comments * Address comments: add note; add helper function * use at::nullopt * add notes on conjugate symmetry; fix complex-to-real cloning condition (should be advanced data layout rather than base_istride) * add at::sum_intlist and at::prod_intlist * revert optional<vector> helper due to windows compiler error
* change irfft signal_sizes arg to be the last * add docs for fft, ifft, rfft, irfft; update doc for stft * fix typo in window function docs * improve gradcheck error message * implement backward of fft, ifft, rfft, irfft * add grad tests for fft, ifft, rfft, irfft * fix nits and typos from pytorch#6118 * address comments
Discovered this bug while looking into the test fail @colesbury saw. In C2C or C2R transform, when any of the input dimension is not aligned to complex type (
stride % 2 != 0), the third party library calls give incorrect results. Added those checks and tests for this.Added test for
ifft+fft == identity. Empirically this only increased test time by 0.1s.@ezyang