asteroid-team / asteroid-filterbanks

Asteroid's filterbanks :rocket:
https://asteroid-team.github.io/
MIT License
80 stars 20 forks source link

Decoder length argument doesn't apply to 2D and 3D tensors #7

Closed faroit closed 3 years ago

faroit commented 3 years ago

The forward path of a Decoder takes an additional length argument. While the shortening of the signal works fine for 1D arrays it fails for 2D and 3D tensor. Since they are supported, this results in a bug which unfortunately is untested.

https://github.com/asteroid-team/asteroid-filterbanks/blob/54a954a174eff3e455215f458c529befc1ad5d29/asteroid_filterbanks/enc_dec.py#L293-L296

The potential fix is a one-liner:

return wav[:length] -> return wav[..., :length]

mpariente commented 3 years ago

Yes, this was very stupid from me, thanks for the issue and the PR