Skip to content

Commit

Permalink
Fix padding
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Gaston Alvarez Franceschi committed Nov 10, 2023
1 parent 8dc23fe commit 8c47c70
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,9 @@ def _istft(
# We need to adapt last dimension
if length is not None:
if length > expected_output_signal_len:
real_result = mb.pad(x=real_result, pad=, mode="constant", constant_val=0, before_op=before_op)
imag_result = mb.pad(x=imag_result, pad=, mode="constant", constant_val=0, before_op=before_op)
right_pad = mb.fill(shape=(channels, expected_output_signal_len - length), value=0., before_op=before_op)
real_result = mb.stack(x=(real_result, right_pad), axis=1, before_op=before_op)
imag_result = mb.stack(x=(imag_result, right_pad), axis=1, before_op=before_op)
elif length < expected_output_signal_len:
real_result = mb.slice_by_size(x=real_result, begin=[0], size=[length], before_op=before_op)
imag_result = mb.slice_by_size(x=imag_result, begin=[0], size=[length], before_op=before_op)
Expand Down

0 comments on commit 8c47c70

Please sign in to comment.