mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-15 01:19:21 +08:00
add fftshift and ifftshift fft helpers (#2135)
* add fftshift and ifftshift fft helpers * address comments * axes have to be iterable * fix fp error in roll + add test --------- Co-authored-by: Aashiq Dheeraj <aashiq@aashiq-mbp-m4.local>
This commit is contained in:
@@ -2961,6 +2961,11 @@ class TestOps(mlx_tests.MLXTestCase):
|
||||
y2 = mx.roll(x, s, a)
|
||||
self.assertTrue(mx.array_equal(y1, y2).item())
|
||||
|
||||
def test_roll_errors(self):
|
||||
x = mx.array([])
|
||||
result = mx.roll(x, [0], [0])
|
||||
self.assertTrue(mx.array_equal(result, x))
|
||||
|
||||
def test_real_imag(self):
|
||||
x = mx.random.uniform(shape=(4, 4))
|
||||
out = mx.real(x)
|
||||
|
||||
Reference in New Issue
Block a user