code: def __init__(
      self,
      num_train_timesteps=1000,
      beta_start=0.0001,
      beta_end=0.02,
      beta_schedule="linear",
      tensor_format="pd",
      skip_prk_steps=False,
  ):
      if beta_schedule == "linear":
          self.betas = np.linspace(
              beta_start,
              beta_end,
              num_train_timesteps,
              dtype=np.float32,
          )
      elif beta_schedule == "scaled_linear":
          # this schedule is very specific to the latent diffusion model.
          self.betas = (
              np.linspace(
                  beta_start**0.5,
                  beta_end**0.5,
                  num_train_timesteps,
                  dtype=np.float32,
              )
              ** 2
          )
      elif beta_schedule == "squaredcos_cap_v2":
          # Glide cosine schedule
          self.betas = betas_for_alpha_bar(num_train_timesteps)
      else:
          raise NotImplementedError(
              f"{beta_schedule} does is not implemented for {self.__class__}"
          )
  
      self.alphas = 1.0 - self.betas
      self.alphas_cumprod = np.cumprod(self.alphas, axis=0)
  
      self.one = np.array(1.0)
  
      # For now we only support F-PNDM, i.e. the runge-kutta method
      # For more information on the algorithm please take a look at the paper: https://arxiv.org/pdf/2202.09778.pdf
      # mainly at formula (9), (12), (13) and the Algorithm 2.
      self.pndm_order = 4
  
      # running values
      self.cur_model_output = 0
      self.counter = 0
      self.cur_sample = None
      self.ets = []
  
      # setable values
      self.num_inference_steps = None
      self._timesteps = np.arange(0, num_train_timesteps)[::-1].copy()
      self._offset = 0
      self.prk_timesteps = None
      self.plms_timesteps = None
      self.timesteps = None
  
      self.tensor_format = tensor_format
      self.set_format(tensor_format=tensor_format)
  
file_path: PaddleHub/modules/image/text_to_image/stable_diffusion/diffusers/schedulers/scheduling_pndm.py
imports: import math
  from typing import Union
  import numpy
  import paddle
  from ..configuration_utils import ConfigMixin
  from ..configuration_utils import register_to_config
  from .scheduling_utils import SchedulerMixin
label_desc: Use image node_id 1 to create a new PNDMScheduler object from inherited base classes: SchedulerMixin, ConfigMixin with example: obj = PNDMScheduler(num_train_timesteps, beta_start, beta_end, beta_schedule, tensor_format, skip_prk_steps)