def call(self, inputs):
        """Calculate forward propagation.
        Args:
            y (Tensor): Groundtruth signal (B, T).
            x (Tensor): Predicted signal (B, T).
        Returns:
            Tensor: Spectral convergence loss value (pre-reduce).
            Tensor: Log STFT magnitude loss value (pre-reduce).
        """
        x, y = inputs
        x_mag = tf.abs(tf.signal.stft(signals=x,
                                              frame_length=self.frame_length,
                                              frame_step=self.frame_step,
                                              fft_length=self.fft_length))
        y_mag = tf.abs(tf.signal.stft(signals=y,
                                              frame_length=self.frame_length,
                                              frame_step=self.frame_step,
                                              fft_length=self.fft_length))
        # print(x_mag.shape,y_mag.shape,self.fft_length)
        # add small number to prevent nan value.
        # compatible with pytorch version.
        x_mag = tf.math.sqrt(x_mag ** 2 + 1e-7)+1e-6
        y_mag = tf.math.sqrt(y_mag ** 2 + 1e-7)+1e-6

        # mel_loss=self.melspec.call(y,x)
        sc_loss = self.spectral_convergenge_loss.call(y_mag, x_mag)

        mag_loss = self.log_stft_magnitude_loss.call(y_mag, x_mag)

        return sc_loss, mag_loss
Calculate forward propagation.
        Args:
            y (Tensor): Groundtruth signal (B, T).
            x (Tensor): Predicted signal (B, T).
        Returns:
            Tensor: Spectral convergence loss value (pre-reduce).
            Tensor: Log STFT magnitude loss value (pre-reduce).
        
vad/utils/stft.py