Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion keras_mlx/src/ops/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,10 @@ def istft(
if length is not None:
end = start + length
elif center is True:
end = -(fft_length // 2)
# Counting back from the expected length rather than from the end of
# the array. A negative index would be -0 when fft_length is 0 or 1,
# which empties the slice instead of keeping everything.
end = expected_output_len - (fft_length // 2)
else:
end = expected_output_len
return x[..., start:end]
Expand Down
Loading