Many thanks for your reply,
I applied a window which is a multiple of the wave length in samples, and now it is as I expected.
However, I have another question.
The output of torchaudio.transforms.Spectrogram is  Exponent for the magnitude spectrogram. So, why we can see the effect of phase shift?