class_docstr: An inverse-STFT layer.
  
  If `output_data_format == 'channels_last'`, the output shape is (batch, time, channel)
  If `output_data_format == 'channels_first'`, the output shape is (batch, channel, time)
  
  Note that the result of inverse STFT could be longer than the original signal due to the padding. Do check the
  size of the result by yourself and trim it if needed.
  
  Args:
      n_fft (int): Number of FFTs. Defaults to `2048`
      win_length (`int` or `None`): Window length in sample. Defaults to `n_fft`.
      hop_length (`int` or `None`): Hop length in sample between analysis windows. Defaults to `n_fft // 4` following Librosa.
      forward_window_name (str or None): *Name* of `tf.signal` function that *was* used in the forward STFT.
          Defaults to `hann_window`, assuming `tf.signal.hann_window` was used.
          Window availability depends on Tensorflow version. More details are at `kapre.backend.get_window()`.
  
      input_data_format (`str`): the data format of input STFT batch
          `'channels_last'` if you want `(batch, time, frequency, channels)`
          `'channels_first'` if you want `(batch, channels, time, frequency)`
          Defaults to the setting of your Keras configuration. (tf.keras.backend.image_data_format())
      output_data_format (`str`): the audio data format of output waveform batch.
          `'channels_last'` if it's `(batch, time, channels)`
          `'channels_first'` if it's `(batch, channels, time)`
          Defaults to the setting of your Keras configuration. (tf.keras.backend.image_data_format())
  
      **kwargs: Keyword args for the parent keras layer (e.g., `name`)
  
  Example:
      ::
  
          input_shape = (3, 513, 1)  # 3 frames, 513 frequency bins, 1 channel
          # and input dtype is complex
          model = Sequential()
          model.add(kapre.InverseSTFT(n_fft=1024, hop_length=512, input_shape=input_shape))
          # now the shape is (batch, time=2048, ch=1)
class_docstr_tok: ["An","inverse-STFT","layer",".","If","`","output_data_format","==","'channels_last","'","`",",","the","output","shape","is","(","batch",",","time",",","channel",")","If","`","output_data_format","==","'channels_first","'","`",",","the","output","shape","is","(","batch",",","channel",",","time",")","Note","that","the","result","of","inverse","STFT","could","be","longer","than","the","original","signal","due","to","the","padding",".","Do","check","the","size","of","the","result","by","yourself","and","trim","it","if","needed",".","Args",":","n_fft","(","int",")",":","Number","of","FFTs",".","Defaults","to","`","2048","`","win_length","(","`","int","`","or","`","None","`",")",":","Window","length","in","sample",".","Defaults","to","`","n_fft","`",".","hop_length","(","`","int","`","or","`","None","`",")",":","Hop","length","in","sample","between","analysis","windows",".","Defaults","to","`","n_fft","\/\/","4","`","following","Librosa",".","forward_window_name","(","str","or","None",")",":","*","Name","*","of","`","tf.signal","`","function","that","*","was","*","used","in","the","forward","STFT",".","Defaults","to","`","hann_window","`",",","assuming","`","tf.signal.hann_window","`","was","used",".","Window","availability","depends","on","Tensorflow","version",".","More","details","are","at","`","kapre.backend.get_window","(",")","`",".","input_data_format","(","`","str","`",")",":","the","data","format","of","input","STFT","batch","`","'channels_last","'","`","if","you","want","`","(","batch",",","time",",","frequency",",","channels",")","`","`","'channels_first","'","`","if","you","want","`","(","batch",",","channels",",","time",",","frequency",")","`","Defaults","to","the","setting","of","your","Keras","configuration",".","(","tf.keras.backend.image_data_format","(",")",")","output_data_format","(","`","str","`",")",":","the","audio","data","format","of","output","waveform","batch",".","`","'channels_last","'","`","if","it","'s","`","(","batch",",","time",",","channels",")","`","`","'channels_first","'","`","if","it","'s","`","(","batch",",","channels",",","time",")","`","Defaults","to","the","setting","of","your","Keras","configuration",".","(","tf.keras.backend.image_data_format","(",")",")","*","*","kwargs",":","Keyword","args","for","the","parent","keras","layer","(","e.g.",",","`","name","`",")","Example",":",":",":","input_shape","=","(","3",",","513",",","1",")","#","3","frames",",","513","frequency","bins",",","1","channel","#","and","input","dtype","is","complex","model","=","Sequential","(",")","model.add","(","kapre.InverseSTFT","(","n_fft=1024",",","hop_length=512",",","input_shape=input_shape",")",")","#","now","the","shape","is","(","batch",",","time=2048",",","ch=1",")"]
docstr: Compute inverse STFT of the input STFT.
  
  Args:
      x (complex `Tensor`): batch of STFTs, (batch, ch, time, freq) or (batch, time, freq, ch) depending on `input_data_format`
  
  Return:
      (`float`): audio signals of x. Shape: 1D batch shape. I.e., (batch, time, ch) or (batch, ch, time) depending on `output_data_format`
docstr_tok: ["Compute","inverse","STFT","of","the","input","STFT",".","Args",":","x","(","complex","`","Tensor","`",")",":","batch","of","STFTs",",","(","batch",",","ch",",","time",",","freq",")","or","(","batch",",","time",",","freq",",","ch",")","depending","on","`","input_data_format","`","Return",":","(","`","float","`",")",":","audio","signals","of","x",".","Shape",":","1D","batch","shape",".","I.e.",",","(","batch",",","time",",","ch",")","or","(","batch",",","ch",",","time",")","depending","on","`","output_data_format","`"]
code: def call(self, x):
      """
      Compute inverse STFT of the input STFT.
  
      Args:
          x (complex `Tensor`): batch of STFTs, (batch, ch, time, freq) or (batch, time, freq, ch) depending on `input_data_format`
  
      Return:
          (`float`): audio signals of x. Shape: 1D batch shape. I.e., (batch, time, ch) or (batch, ch, time) depending on `output_data_format`
  
      """
      stfts = x  # (batch, ch, time, freq) if input_data_format == 'channels_first'.
      # (batch, time, freq, ch) if input_data_format == 'channels_last'.
  
      # this is needed because tf.signal.stft lives in channels_first land.
      if self.input_data_format == _CH_LAST_STR:
          stfts = tf.transpose(
              stfts, perm=(0, 3, 1, 2)
          )  # now always (b, ch, t, f)
  
      waveforms = tf.signal.inverse_stft(
          stfts=stfts,
          frame_length=self.win_length,
          frame_step=self.hop_length,
          fft_length=self.n_fft,
          window_fn=self.window_fn,
          name="%s_tf.signal.istft" % self.name,
      )  # (batch, ch, time)
  
      if self.output_data_format == _CH_LAST_STR:
          waveforms = tf.transpose(
              waveforms, perm=(0, 2, 1)
          )  # (batch, time, ch)
  
      return waveforms
  
imports: import tensorflow
  from tensorflow.keras import backend
  from tensorflow.keras.layers import Layer
  from .None import backend
  from .backend import _CH_FIRST_STR, _CH_LAST_STR, _CH_DEFAULT_STR
  from .tflite_compatible_stft import atan2_tflite
label_desc: Use image node_id 2 for calling the InverseSTFT obj's underlying member method code with example usage: obj.call(x) and returns: waveforms