mirror of
				https://github.com/ml-explore/mlx.git
				synced 2025-11-04 02:28:13 +08:00 
			
		
		
		
	irfft throws instead of segfaults on scalars (#2109)
This commit is contained in:
		@@ -194,6 +194,11 @@ class TestFFT(mlx_tests.MLXTestCase):
 | 
			
		||||
        r_np = np.fft.ifft(segment, n=n_fft)
 | 
			
		||||
        self.assertTrue(np.allclose(r, r_np, atol=1e-5, rtol=1e-5))
 | 
			
		||||
 | 
			
		||||
    def test_fft_throws(self):
 | 
			
		||||
        x = mx.array(3.0)
 | 
			
		||||
        with self.assertRaises(ValueError):
 | 
			
		||||
            mx.fft.irfftn(x)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    unittest.main()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user