code: def test_stft_loss():
      stft_loss = STFTLoss(ap.fft_size, ap.hop_length, ap.win_length)
      wav = ap.load_wav(WAV_FILE)
      wav = torch.from_numpy(wav[None, :]).float()
      loss_m, loss_sc = stft_loss(wav, wav)
      assert loss_m + loss_sc == 0
      loss_m, loss_sc = stft_loss(wav, torch.rand_like(wav))
      assert loss_sc < 1.0
      assert loss_m + loss_sc > 0
  
file_path: TTS/tests/test_vocoder_losses.py
imports: import os
  import torch
  from tests import get_tests_input_path, get_tests_output_path, get_tests_path
  from TTS.utils.audio import AudioProcessor
  from TTS.utils.io import load_config
  from TTS.vocoder.layers.losses import MultiScaleSTFTLoss, STFTLoss, TorchSTFT
label_desc: Use image node_id 2 for calling a global function with example usage: test_stft_loss() without return types