class_docstr: Apply a filterbank to the input spectrograms.
  
  Args:
      filterbank (`Tensor`): filterbank tensor in a shape of (n_freq, n_filterbanks)
      data_format (`str`): specifies the data format of batch input/output
      **kwargs: Keyword args for the parent keras layer (e.g., `name`)
  
  Example:
      ::
  
          input_shape = (2048, 1)  # mono signal
          n_fft = 1024
          n_hop = n_fft // 2
          kwargs = {
              'sample_rate': 22050,
              'n_freq': n_fft // 2 + 1,
              'n_mels': 128,
              'f_min': 0.0,
              'f_max': 8000,
          }
          model = Sequential()
          model.add(kapre.STFT(n_fft=n_fft, hop_length=n_hop, input_shape=input_shape))
          model.add(Magnitude())
          # (batch, n_frame=3, n_freq=n_fft // 2 + 1, ch=1) and dtype is float
          model.add(ApplyFilterbank(type='mel', filterbank_kwargs=kwargs))
          # (batch, n_frame=3, n_mels=128, ch=1)
class_docstr_tok: ["Apply","a","filterbank","to","the","input","spectrograms",".","Args",":","filterbank","(","`","Tensor","`",")",":","filterbank","tensor","in","a","shape","of","(","n_freq",",","n_filterbanks",")","data_format","(","`","str","`",")",":","specifies","the","data","format","of","batch","input\/output","*","*","kwargs",":","Keyword","args","for","the","parent","keras","layer","(","e.g.",",","`","name","`",")","Example",":",":",":","input_shape","=","(","2048",",","1",")","#","mono","signal","n_fft","=","1024","n_hop","=","n_fft","\/\/","2","kwargs","=","{","'sample_rate","'",":","22050",",","'n_freq","'",":","n_fft","\/\/","2","+","1",",","'n_mels","'",":","128",",","'f_min","'",":","0.0",",","'f_max","'",":","8000",",","}","model","=","Sequential","(",")","model.add","(","kapre.STFT","(","n_fft=n_fft",",","hop_length=n_hop",",","input_shape=input_shape",")",")","model.add","(","Magnitude","(",")",")","#","(","batch",",","n_frame=3",",","n_freq=n_fft","\/\/","2","+","1",",","ch=1",")","and","dtype","is","float","model.add","(","ApplyFilterbank","(","type='mel","'",",","filterbank_kwargs=kwargs",")",")","#","(","batch",",","n_frame=3",",","n_mels=128",",","ch=1",")"]
docstr: Apply filterbank to `x`.
  
  Args:
      x (`Tensor`): float tensor in 2D batch shape.
docstr_tok: ["Apply","filterbank","to","`","x","`",".","Args",":","x","(","`","Tensor","`",")",":","float","tensor","in","2D","batch","shape","."]
code: def call(self, x):
      """
      Apply filterbank to `x`.
  
      Args:
          x (`Tensor`): float tensor in 2D batch shape.
      """
  
      # x: 2d batch input. (b, t, fr, ch) or (b, ch, t, fr)
      output = tf.tensordot(
          x, self.filterbank, axes=(self.freq_axis, 0)
      )
      # ch_last -> (b, t, ch, new_fr). ch_first -> (b, ch, t, new_fr)
      if self.data_format == _CH_LAST_STR:
          output = tf.transpose(output, (0, 1, 3, 2))
      return output
  
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 ApplyFilterbank obj's underlying member method code with example usage: obj.call(x) and returns: output