class_docstr: A mapping between continuous noise levels (sigmas) and a list of discrete noise
  levels.
class_docstr_tok: ["A","mapping","between","continuous","noise","levels","(","sigmas",")","and","a","list","of","discrete","noise","levels","."]
code: def sigma_to_t(self, sigma, quantize=None):
      quantize = self.quantize if quantize is None else quantize
      log_sigma = sigma.log()
      dists = log_sigma - self.log_sigmas[:, None]
      if quantize:
          return dists.abs().argmin(dim=0).view(sigma.shape)
      low_idx = (
          dists.ge(0)
          .cumsum(dim=0)
          .argmax(dim=0)
          .clamp(max=self.log_sigmas.shape[0] - 2)
      )
      high_idx = low_idx + 1
      low, high = self.log_sigmas[low_idx], self.log_sigmas[high_idx]
      w = (low - log_sigma) / (low - high)
      w = w.clamp(0, 1)
      t = (1 - w) * low_idx + w * high_idx
      return t.view(sigma.shape)
  
imports: import math
  import torch
  import torchsde
  from scipy import integrate
  from torch import nn
  from torchdiffeq import odeint
  from tqdm.auto import tqdm, trange
label_desc: Use image node_id 5 for calling the DiscreteSchedule obj's underlying member method code with example usage: obj.sigma_to_t(sigma, quantize) and returns: t, dists