mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
irfft throws instead of segfaults on scalars (#2109)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
// Copyright © 2023 Apple Inc.
|
||||
|
||||
#include <numeric>
|
||||
#include <set>
|
||||
|
||||
@@ -109,7 +108,7 @@ array fft_impl(
|
||||
for (auto ax : axes) {
|
||||
n.push_back(a.shape(ax));
|
||||
}
|
||||
if (real && inverse) {
|
||||
if (real && inverse && a.ndim() > 0) {
|
||||
n.back() = (n.back() - 1) * 2;
|
||||
}
|
||||
return fft_impl(a, n, axes, real, inverse, s);
|
||||
|
||||
Reference in New Issue
Block a user