class_docstr: Time warping using torch.interpolate.
  
  Args:
      window: time warp parameter
      mode: Interpolate mode
docstr: Forward function.
  
  Args:
      x: (Batch, Time, Freq)
      x_lengths: (Batch,)
docstr_tok: ["Forward","function",".","Args",":","x",":","(","Batch",",","Time",",","Freq",")","x_lengths",":","(","Batch",",",")"]
code: def forward(self, x: torch.Tensor, x_lengths: torch.Tensor = None):
      """Forward function.
  
      Args:
          x: (Batch, Time, Freq)
          x_lengths: (Batch,)
      """
  
      if x_lengths is None or all(
          le == x_lengths[0] for le in x_lengths
      ):
          # Note that applying same warping for each sample
          y = time_warp(x, window=self.window, mode=self.mode)
      else:
          # FIXME(kamo): I have no idea to batchify Timewarp
          ys = []
          for i in range(x.size(0)):
              _y = time_warp(
                  x[i][None, : x_lengths[i]],
                  window=self.window,
                  mode=self.mode,
              )[0]
              ys.append(_y)
          y = pad_list(ys, 0.0)
  
      return y, x_lengths
  
imports: import torch
  from espnet.nets.pytorch_backend.nets_utils import pad_list
label_desc: Use image node_id 3 for calling the TimeWarp obj's underlying member method code with example usage: obj.forward(x, x_lengths) and returns: y,  x_lengths