docstr: Step function propagating the sample with the linear multi-step method. This has one forward pass with multiple
  times to approximate the solution.
docstr_tok: ["Step","function","propagating","the","sample","with","the","linear","multi-step","method",".","This","has","one","forward","pass","with","multiple","times","to","approximate","the","solution","."]
code: def step_plms(
      self,
      model_output: Union[paddle.Tensor, np.ndarray],
      timestep: int,
      sample: Union[paddle.Tensor, np.ndarray],
  ):
      """
      Step function propagating the sample with the linear multi-step method. This has one forward pass with multiple
      times to approximate the solution.
      """
      if not self.config.skip_prk_steps and len(self.ets) < 3:
          raise ValueError(
              f"{self.__class__} can only be run AFTER scheduler has been run "
              "in 'prk' mode for at least 12 iterations "
              "See: https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_pndm.py "
              "for more information."
          )
  
      prev_timestep = max(
          timestep
          - self.config.num_train_timesteps // self.num_inference_steps,
          0,
      )
  
      if self.counter != 1:
          self.ets.append(model_output)
      else:
          prev_timestep = timestep
          timestep = (
              timestep
              + self.config.num_train_timesteps
              // self.num_inference_steps
          )
  
      if len(self.ets) == 1 and self.counter == 0:
          model_output = model_output
          self.cur_sample = sample
      elif len(self.ets) == 1 and self.counter == 1:
          model_output = (model_output + self.ets[-1]) / 2
          sample = self.cur_sample
          self.cur_sample = None
      elif len(self.ets) == 2:
          model_output = (3 * self.ets[-1] - self.ets[-2]) / 2
      elif len(self.ets) == 3:
          model_output = (
              23 * self.ets[-1] - 16 * self.ets[-2] + 5 * self.ets[-3]
          ) / 12
      else:
          model_output = (1 / 24) * (
              55 * self.ets[-1]
              - 59 * self.ets[-2]
              + 37 * self.ets[-3]
              - 9 * self.ets[-4]
          )
  
      prev_sample = self._get_prev_sample(
          sample, timestep, prev_timestep, model_output
      )
      self.counter += 1
  
      return {"prev_sample": 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 5 for calling the PNDMScheduler obj's underlying member method code with example usage: obj.step_plms(model_output, timestep, sample) and returns: dict