Small torchaudio PR for non-persistent recomputable transform buffers

Hi everyone,

I opened a small torchaudio PR addressing issue #3059 around recomputable transform buffers being persisted in state_dict.

The PR updates recomputable buffers to use register_buffer(..., persistent=False) for:

  • Spectrogram

  • InverseSpectrogram

  • Resample

The motivation is that these buffers can be reconstructed from constructor arguments, so persisting them can create unnecessary checkpoint compatibility friction.

I also added tests covering the expected state_dict behavior.

Issue: #3059
PR: Use non-persistent buffers for recomputable transform state by pdTetteh · Pull Request #4186 · pytorch/audio · GitHub

Since the torchaudio repo notes that it is no longer actively monitored in the usual way, I wanted to share the PR here for visibility.

Thanks.