class_docstr: Helper functions to compute specgrams.
class_docstr_tok: ["Helper","functions","to","compute","specgrams","."]
docstr: Convert from waves to complex stfts.
  
  Args:
    waves: Tensor of the waveform, shape [batch, time, 1].
  
  Returns:
    stfts: Complex64 tensor of stft, shape [batch, time, freq, 1].
docstr_tok: ["Convert","from","waves","to","complex","stfts",".","Args",":","waves",":","Tensor","of","the","waveform",",","shape","[","batch",",","time",",","1","]",".","Returns",":","stfts",":","Complex64","tensor","of","stft",",","shape","[","batch",",","time",",","freq",",","1","]","."]
code: def waves_to_stfts(self, waves):
      """Convert from waves to complex stfts.
  
      Args:
        waves: Tensor of the waveform, shape [batch, time, 1].
  
      Returns:
        stfts: Complex64 tensor of stft, shape [batch, time, freq, 1].
      """
      waves_padded = tf.pad(
          waves, [[0, 0], [self._pad_l, self._pad_r], [0, 0]]
      )
      stfts = tf.signal.stft(
          waves_padded[:, :, 0],
          frame_length=self._nfft,
          frame_step=self._nhop,
          fft_length=self._nfft,
          pad_end=False,
      )[:, :, :, tf.newaxis]
      stfts = stfts[:, :, 1:] if self._discard_dc else stfts[:, :, :-1]
      stft_shape = stfts.get_shape().as_list()[1:3]
      if tuple(stft_shape) != tuple(self._spec_shape):
          raise ValueError(
              "Spectrogram returned the wrong shape {}, is not the same as the "
              "constructor spec_shape {}.".format(
                  stft_shape, self._spec_shape
              )
          )
      return stfts
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from magenta.models.gansynth.lib import spectral_ops
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 5 for calling the SpecgramsHelper obj's underlying member method code with example usage: obj.waves_to_stfts(waves) and returns: stfts