asteroid-team / asteroid

The PyTorch-based audio source separation toolkit for researchers
https://asteroid-team.github.io/
MIT License
2.21k stars 419 forks source link

Quick fix for XUMX in torch 2.0 #684

Closed DavidDiazGuerra closed 5 months ago

DavidDiazGuerra commented 10 months ago

Hello!

I know we should ideally rewrite the XUMX model to work with the new torch's complex type, but it is possible to workaround this by just converting the new type to the old format just after calling torch.stft using torch.view_as_real and then converting it back to the new type with torch.view_as_complex before calling to torch.istft (#662) . This is not the ideal solution but I think it would be useful to allow people to keep using XUMX till the model is fully rewrited.

Best, David

mpariente commented 10 months ago

Thank you very much for the PR !

@r-sawata, do you agree ?

r-sawata commented 5 months ago

Yea I confirmed this PR and actually tried to run it on my local. It looks having no any problems and will be suitable for future update of PyTorch, so I totally agree with this PR.

Thank you so much for your PR, @DavidDiazGuerra.

Could you merge this to master if you're fine, @mpariente?