class_docstr: Helper functions to compute specgrams.
class_docstr_tok: ["Helper","functions","to","compute","specgrams","."]
docstr: Infer left and right padding for STFT.
docstr_tok: ["Infer","left","and","right","padding","for","STFT","."]
code: def _get_padding(self):
      """Infer left and right padding for STFT."""
      n_samps_inv = self._nhop * (self._spec_shape[0] - 1) + self._nfft
      if n_samps_inv < self._audio_length:
          raise ValueError(
              "Wrong audio length. Number of ISTFT samples, %d, should"
              " be less than audio lengeth %d" % self._audio_length
          )
  
      # For Nsynth dataset, we are putting all padding in the front
      # This causes edge effects in the tail
      padding = n_samps_inv - self._audio_length
      padding_l = padding
      padding_r = padding - padding_l
      return padding_l, padding_r
  
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 4 for calling the SpecgramsHelper obj's underlying member method code with example usage: obj._get_padding() and returns: padding_l,  padding_r