class_docstr: Calculates delta, a local estimate of the derivative along time axis.
  See torchaudio.functional.compute_deltas or librosa.feature.delta for more details.
  
  Args:
      win_length (int): Window length of the derivative estimation. Defaults to 5
      mode (`str`): Specifies pad mode of `tf.pad`. Case-insensitive. Defaults to 'symmetric'.
          Can be 'symmetric', 'reflect', 'constant', or whatever `tf.pad` supports.
  
  Example:
      ::
  
          input_shape = (2048, 1)  # mono signal
          model = Sequential()
          model.add(kapre.STFT(n_fft=1024, hop_length=512, input_shape=input_shape))
          model.add(kapre.Magnitude())
          model.add(Delta())
          # (batch, n_frame=3, n_freq=513, ch=1) and dtype is float
class_docstr_tok: ["Calculates","delta",",","a","local","estimate","of","the","derivative","along","time","axis",".","See","torchaudio.functional.compute_deltas","or","librosa.feature.delta","for","more","details",".","Args",":","win_length","(","int",")",":","Window","length","of","the","derivative","estimation",".","Defaults","to","5","mode","(","`","str","`",")",":","Specifies","pad","mode","of","`","tf.pad","`",".","Case-insensitive",".","Defaults","to","'symmetric","'",".","Can","be","'symmetric","'",",","'reflect","'",",","'constant","'",",","or","whatever","`","tf.pad","`","supports",".","Example",":",":",":","input_shape","=","(","2048",",","1",")","#","mono","signal","model","=","Sequential","(",")","model.add","(","kapre.STFT","(","n_fft=1024",",","hop_length=512",",","input_shape=input_shape",")",")","model.add","(","kapre.Magnitude","(",")",")","model.add","(","Delta","(",")",")","#","(","batch",",","n_frame=3",",","n_freq=513",",","ch=1",")","and","dtype","is","float"]
docstr: Args:
      x (`Tensor`): a 2d batch (b, t, f, ch) or (b, ch, t, f)
  
  Returns:
      (`Tensor`): A tensor with the same shape as input data.
docstr_tok: ["Args",":","x","(","`","Tensor","`",")",":","a","2d","batch","(","b",",","t",",","f",",","ch",")","or","(","b",",","ch",",","t",",","f",")","Returns",":","(","`","Tensor","`",")",":","A","tensor","with","the","same","shape","as","input","data","."]
code: def call(self, x):
      """
      Args:
          x (`Tensor`): a 2d batch (b, t, f, ch) or (b, ch, t, f)
  
      Returns:
          (`Tensor`): A tensor with the same shape as input data.
      """
      if self.data_format == "channels_first":
          x = K.permute_dimensions(x, (0, 2, 3, 1))
  
      x = tf.pad(
          x,
          tf.constant([[0, 0], [self.n, self.n], [0, 0], [0, 0]]),
          mode=self.mode,
      )  # pad over time
      kernel = K.arange(-self.n, self.n + 1, 1, dtype=K.floatx())
      kernel = K.reshape(
          kernel, (-1, 1, 1, 1)
      )  # time, freq, in_ch, out_ch
  
      x = K.conv2d(x, kernel, data_format=_CH_LAST_STR) / self.denom
      if self.data_format == _CH_FIRST_STR:
          x = K.permute_dimensions(x, (0, 3, 1, 2))
  
      return x
  
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 Delta obj's underlying member method code with example usage: obj.call(x) and returns: x