Skip to content

Commit e387d0d

Browse files
Fix vectorization for stft (#18)
1 parent 4f1ee15 commit e387d0d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/nx_signal.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ defmodule NxSignal do
355355
output = Nx.broadcast(Nx.tensor(0, type: tensor.type), output_shape)
356356
{num_windows, _} = Nx.shape(output)
357357

358+
[output, tensor] = Nx.broadcast_vectors([output, tensor])
359+
358360
{output, _, _, _} =
359361
while {output, i = 0, current_window = 0, t = tensor}, current_window < num_windows do
360362
window = t |> Nx.slice([i], [window_length])

0 commit comments

Comments
 (0)