I cannot reproduce. Can you provide a minimal example?
import torchaudio

device = "cuda"

waveform, sample_rate = torchaudio.load("sinewave.wav") # from audio/test/torchaudio_unittest/assets
waveform = waveform.to(device)

mel_spec = torchaudio.transforms.MelSpectrogram(sample_rate = sample_rate, n_fft = 1024, n_mels = 256, hop_length = 63).to(device)
to_dB = torchaudio.transforms.AmplitudeToDB().to(device)

images = to_dB(mel_spec(waveform))