code: def _get_prev_sample(
      self, sample, timestep, timestep_prev, model_output
  ):
      # See formula (9) of PNDM paper https://arxiv.org/pdf/2202.09778.pdf
      # this function computes x_(t−δ) using the formula of (9)
      # Note that x_t needs to be added to both sides of the equation
  
      # Notation (<variable name> -> <name in paper>
      # alpha_prod_t -> α_t
      # alpha_prod_t_prev -> α_(t−δ)
      # beta_prod_t -> (1 - α_t)
      # beta_prod_t_prev -> (1 - α_(t−δ))
      # sample -> x_t
      # model_output -> e_θ(x_t, t)
      # prev_sample -> x_(t−δ)
      alpha_prod_t = self.alphas_cumprod[timestep + 1 - self._offset]
      alpha_prod_t_prev = self.alphas_cumprod[
          timestep_prev + 1 - self._offset
      ]
      beta_prod_t = 1 - alpha_prod_t
      beta_prod_t_prev = 1 - alpha_prod_t_prev
  
      # corresponds to (α_(t−δ) - α_t) divided by
      # denominator of x_t in formula (9) and plus 1
      # Note: (α_(t−δ) - α_t) / (sqrt(α_t) * (sqrt(α_(t−δ)) + sqr(α_t))) =
      # sqrt(α_(t−δ)) / sqrt(α_t))
      sample_coeff = (alpha_prod_t_prev / alpha_prod_t) ** (0.5)
  
      # corresponds to denominator of e_θ(x_t, t) in formula (9)
      model_output_denom_coeff = alpha_prod_t * beta_prod_t_prev ** (
          0.5
      ) + (alpha_prod_t * beta_prod_t * alpha_prod_t_prev) ** (0.5)
  
      # full formula (9)
      prev_sample = (
          sample_coeff * sample
          - (alpha_prod_t_prev - alpha_prod_t)
          * model_output
          / model_output_denom_coeff
      )
  
      return prev_sample
  
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 6 for calling the PNDMScheduler obj's underlying member method code with example usage: obj._get_prev_sample(sample, timestep, timestep_prev, model_output) and returns: prev_sample