You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your wonderful project. I would love to make my first speechbrain contribution and help fix this issue :). when I encode a mel spectrogram using a CPU using MelSpectrogramEncoder, the underlying mel spectrogram data is modified
Expected behaviour
Calculating the embedding should not modify the original data
Thanks for the convenient repro. I would note that this is not really specific to the CPU device: The bug seems to be in-place modification of the input tensor.
Since you're passing a CPU tensor in the second example, it gets migrated to CUDA and thus effectively cloned. If you .to("cuda") the waveform yourself the bug also reproduces.
The bug is in InputNormalization when the norm_type is either "sentence" or "speaker", in which case it performs in-place assignments. I will make a PR soon.
Describe the bug
Thanks for your wonderful project. I would love to make my first speechbrain contribution and help fix this issue :). when I encode a mel spectrogram using a CPU using MelSpectrogramEncoder, the underlying mel spectrogram data is modified
Expected behaviour
Calculating the embedding should not modify the original data
To Reproduce
test_in_place.py
python tests/test_in_place.py
tensor(33.1424)
tensor(0.)
Environment Details
speechbrain '0.5.16'
Relevant Log Output
No response
Additional Context
It only happens with CPU
The text was updated successfully, but these errors were encountered: