docstr: The dynamic thresholding method.
docstr_tok: ["The","dynamic","thresholding","method","."]
code: def dynamic_thresholding_fn(self, x0, t=None):
      """
      The dynamic thresholding method.
      """
      dims = x0.dim()
      p = self.dynamic_thresholding_ratio
      s = torch.quantile(
          torch.abs(x0).reshape((x0.shape[0], -1)), p, dim=1
      )
      s = expand_dims(
          torch.maximum(
              s,
              self.thresholding_max_val
              * torch.ones_like(s).to(s.device),
          ),
          dims,
      )
      x0 = torch.clamp(x0, -s, s) / s
      return x0
  
imports: import torch
  import math
  import tqdm
label_desc: Use image node_id 2 for calling the UniPC obj's underlying member method code with example usage: obj.dynamic_thresholding_fn(x0, t) and returns: x0