code: def __init__(
      self,
      linear_start=0.00085,
      linear_end=0.0120,
      num_timesteps=1000,
  ):
      super().__init__()
      self.num_timesteps = num_timesteps
      betas = make_beta_schedule(
          "linear",
          num_timesteps,
          linear_start=linear_start,
          linear_end=linear_end,
      )
      alphas = 1.0 - betas
      self.alphas_cumprod = np.cumprod(alphas, axis=0)
      self.to_torch = partial(torch.tensor, dtype=torch.float32)
  
file_path: generative-models/sgm/modules/diffusionmodules/discretizer.py
imports: from abc import abstractmethod
  from functools import partial
  import numpy
  import torch
  from ...modules.diffusionmodules.util import make_beta_schedule
  from ...util import append_zero
label_desc: Use image node_id 1 to create a new LegacyDDPMDiscretization object from inherited base classes: Discretization with example: obj = LegacyDDPMDiscretization(linear_start, linear_end, num_timesteps)