I guess the input shape might be wrong.
From the docs 2:


n_mels (int, optional) – Number of mel filterbanks. (Default: 128)
…

melspec (Tensor) – A Mel frequency spectrogram of dimension (…, n_mels, time)

Based on this it seems the n_mels argument is set to 128 by default, while your input tensor has a value of 432 in this dimension.