class_docstr: Computes delta coefficients (time derivatives).
  
  Arguments
  ---------
  win_length : int
      Length of the window used to compute the time derivatives.
  
  Example
  -------
  >>> inputs = torch.randn([10, 101, 20])
  >>> compute_deltas = Deltas(input_size=inputs.size(-1))
  >>> features = compute_deltas(inputs)
  >>> features.shape
  torch.Size([10, 101, 20])
class_docstr_tok: ["Computes","delta","coefficients","(","time","derivatives",")",".","Arguments","--","--","--","--","-","win_length",":","int","Length","of","the","window","used","to","compute","the","time","derivatives",".","Example","--","--","--","-",">",">",">","inputs","=","torch.randn","(","[","10",",","101",",","20","]",")",">",">",">","compute_deltas","=","Deltas","(","input_size=inputs.size","(","-1",")",")",">",">",">","features","=","compute_deltas","(","inputs",")",">",">",">","features.shape","torch.Size","(","[","10",",","101",",","20","]",")"]
docstr: Returns the delta coefficients.
  
  Arguments
  ---------
  x : tensor
      A batch of tensors.
docstr_tok: ["Returns","the","delta","coefficients",".","Arguments","--","--","--","--","-","x",":","tensor","A","batch","of","tensors","."]
code: def forward(self, x):
      """Returns the delta coefficients.
  
      Arguments
      ---------
      x : tensor
          A batch of tensors.
      """
      # Managing multi-channel deltas reshape tensor (batch*channel,time)
      x = x.transpose(1, 2).transpose(2, -1)
      or_shape = x.shape
      if len(or_shape) == 4:
          x = x.reshape(
              or_shape[0] * or_shape[2], or_shape[1], or_shape[3]
          )
  
      # Padding for time borders
      x = torch.nn.functional.pad(x, (self.n, self.n), mode="replicate")
  
      # Derivative estimation (with a fixed convolutional kernel)
      delta_coeff = (
          torch.nn.functional.conv1d(
              x, self.kernel.to(x.device), groups=x.shape[1]
          )
          / self.denom
      )
  
      # Retrieving the original dimensionality (for multi-channel case)
      if len(or_shape) == 4:
          delta_coeff = delta_coeff.reshape(
              or_shape[0],
              or_shape[1],
              or_shape[2],
              or_shape[3],
          )
      delta_coeff = delta_coeff.transpose(1, -1).transpose(2, -1)
  
      return delta_coeff
  
imports: import math
  import torch
  import logging
  from speechbrain.utils.checkpoints import mark_as_saver, mark_as_loader, mark_as_transfer, register_checkpoint_hooks
  from speechbrain.dataio.dataio import length_to_mask
label_desc: Use image node_id 2 for calling the Deltas obj's underlying member method code with example usage: obj.forward(x) and returns: delta_coeff