Skip to content

Commit

Permalink
[MPS] Add regression test for fft.fftfreq (#135440)
Browse files Browse the repository at this point in the history
The issue reported in #135223 was already solved in #128393. This PR adds a regression test for it.

Fixes #135223

Pull Request resolved: pytorch/pytorch#135440
Approved by: https://github.com/ezyang
  • Loading branch information
hvaara authored and pytorchmergebot committed Sep 9, 2024
1 parent 16c3b8f commit 09287e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/test_mps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2732,6 +2732,12 @@ def test_ifft(self):
# Expecting the inverted to yield the original signal
self.assertEqual(ifft_result, signal)

# Regression test for https://github.com/pytorch/pytorch/issues/135223
def test_fftfreq(self):
freq_cpu = torch.fft.fftfreq(10**4, device='cpu')
freq_mps = torch.fft.fftfreq(10**4, device='mps')
self.assertEqual(freq_cpu, freq_mps)

def test_instance_norm(self):
def helper(shape, eps=1, momentum=0.1, wts=False, channels_last=False, track_running_stats=True, test_module=False):

Expand Down

0 comments on commit 09287e3

Please sign in to comment.