Skip to content

Commit

Permalink
Fix padding (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
loubbrad authored Aug 14, 2024
1 parent 352de4a commit 51b011e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions amt/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,9 @@ def get_wav_segments(
yield buffer

if pad_last == True:
yield torch.cat(
(
buffer[stride_samples:],
torch.zeros(stride_samples, dtype=torch.float32),
),
dim=0,
yield torch.nn.functional.pad(
buffer[stride_samples:],
(0.0, chunk_samples - len(buffer[stride_samples:])),
)


Expand Down

0 comments on commit 51b011e

Please sign in to comment.