Fix HFFT tests to use complex input tensors#1533
Fix HFFT tests to use complex input tensors#1533alinpahontu2912 wants to merge 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes the HFFT test suite to use complex input tensors as required by PyTorch's hfft/hfft2/hfftn functions. These functions expect Hermitian symmetric complex inputs and produce real-valued outputs. The tests were incorrectly using real-valued Float32/Float64 input tensors, which causes 'NYI' (Not Yet Implemented) errors in newer PyTorch versions.
Changes:
- Updated input tensor creation in HFFT tests to use complex64/complex128 instead of Float32/Float64 scalar types
- Changed inverse verification from ifft to ihfft (the correct inverse of hfft)
- Fixed output dtype assertions to explicitly check for Float32/Float64 instead of comparing with input dtype
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot fix the comment |
|
@alinpahontu2912 I've opened a new pull request, #1539, to work on those changes. Once the pull request is ready, I'll request review from you. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PyTorch's fft.hfft/hfft2/hfftn require complex input tensors. The tests were passing real-valued tensors (Float32/Float64), which causes 'NYI' errors in newer PyTorch versions. Fixed by using complex64/complex128 input types and ihfft for inverse verification. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The test method was incorrectly calling fft.hfft2() instead of fft.hfftn(), and using ihfft2() instead of ihfftn() for verification. Updated the TestOf attribute to match the correct function being tested. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Removed Float32HFFT and Float64HFFT as they were duplicates of ComplexFloat versions. Renamed Float32HFFT2/N and Float64HFFT2/N to ComplexFloat... to reflect input type. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
74e9189 to
f3bab3e
Compare
PyTorch's fft.hfft/hfft2/hfftn require complex input tensors. The tests were passing real-valued tensors (Float32/Float64), which causes 'NYI' errors in newer PyTorch versions. Fixed by using complex64/complex128 input types and ihfft for inverse verification.