docstr: Compute soft-DTW by dynamic programming.
  
  Returns
  -------
  sdtw: float
      soft-DTW discrepancy.
docstr_tok: ["Compute","soft-DTW","by","dynamic","programming",".","Returns","--","--","--","-","sdtw",":","float","soft-DTW","discrepancy","."]
code: def compute(self):
      """Compute soft-DTW by dynamic programming.
  
      Returns
      -------
      sdtw: float
          soft-DTW discrepancy.
      """
      m, n = self.be.shape(self.D)
  
      if self.be.is_numpy:
          _njit_soft_dtw(self.D, self.R_, gamma=self.gamma)
      elif not self.compute_with_backend:
          _njit_soft_dtw(
              self.be.to_numpy(self.D),
              self.be.to_numpy(self.R_),
              gamma=self.be.to_numpy(self.gamma),
          )
          self.R_ = self.be.array(self.R_)
      else:
          _soft_dtw(self.D, self.R_, gamma=self.gamma, be=self.be)
  
      self.computed = True
  
      return self.R_[m, n]
  
imports: import numpy
  from joblib import Parallel, delayed
  from numba import njit
  from sklearn.utils import check_random_state
  from tslearn.backend import instantiate_backend
  from tslearn.utils import check_equal_size, to_time_series, to_time_series_dataset, ts_size
  from .dtw_variants import dtw, dtw_path
  from .soft_dtw_fast import _jacobian_product_sq_euc, _njit_jacobian_product_sq_euc, _njit_soft_dtw, _njit_soft_dtw_grad, _soft_dtw, _soft_dtw_grad
  from .utils import _cdist_generic
label_desc: Use image node_id 2 for calling the SoftDTW obj's underlying member method code with example usage: obj.compute() and returns: self