microsoft / onnxscript

ONNX Script enables developers to naturally author ONNX functions and models using a subset of Python.
https://onnxscript.ai/
MIT License
285 stars 54 forks source link

[torchlib] Fix _fft_c2r #1844

Open justinchuby opened 2 months ago

justinchuby commented 2 months ago

Fix https://github.com/microsoft/onnxscript/issues/1271

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 10.81081% with 33 lines in your changes missing coverage. Please review.

Project coverage is 74.92%. Comparing base (2e45a32) to head (af7a47c). Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
onnxscript/function_libs/torch_lib/ops/fft.py 10.81% 33 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1844 +/- ## ========================================== - Coverage 75.07% 74.92% -0.15% ========================================== Files 249 249 Lines 27046 27060 +14 Branches 4943 4945 +2 ========================================== - Hits 20304 20276 -28 - Misses 5797 5839 +42 Partials 945 945 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

justinchuby commented 2 months ago

https://github.com/pytorch/pytorch/blob/a00fad017719346bac6e08da0819358146e647e3/torch/_refs/fft.py#L134

justinchuby commented 2 months ago

r2c needs conjugation: https://github.com/pytorch/pytorch/blob/a00fad017719346bac6e08da0819358146e647e3/torch/_refs/fft.py#L169

justinchuby commented 2 months ago

Just specify dft_length