8000 [MPS] Add regression test for `fft.fftfreq` (#137215) · pytorch/pytorch@783a6a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 783a6a4

Browse files
pytorchbothvaara
andauthored
[MPS] Add regression test for fft.fftfreq (#137215)
[MPS] Add regression test for `fft.fftfreq` (#135440) The issue reported in #135223 was already solved in #128393. This PR adds a regression test for it. Fixes #135223 Pull Request resolved: #135440 Approved by: https://github.com/ezyang (cherry picked from commit 09287e3) Co-authored-by: Roy Hvaara <roy@lightyear.no>
1 parent 5375201 commit 783a6a4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/test_mps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,6 +2732,12 @@ def test_ifft(self):
27322732
# Expecting the inverted to yield the original signal
27332733
self.assertEqual(ifft_result, signal)
27342734

2735+
# Regression test for https://github.com/pytorch/pytorch/issues/135223
2736+
def test_fftfreq(self):
2737+
freq_cpu = torch.fft.fftfreq(10**4, device='cpu')
2738+
freq_mps = torch.fft.fftfreq(10**4, device='mps')
2739+
self.assertEqual(freq_cpu, freq_mps)
2740+
27352741
def test_instance_norm(self):
27362742
def helper(shape, eps=1, momentum=0.1, wts=False, channels_last=False, track_running_stats=True, test_module=False):
27372743

0 commit comments

Comments
 (0)
0