Skip to content

Commit

Permalink
Workaround data dependent control flow issues in PNDM
Browse files Browse the repository at this point in the history
  • Loading branch information
monorimet authored Apr 4, 2024
1 parent bb1b76d commit 22fbaf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/diffusers/schedulers/scheduling_pndm.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def _get_prev_sample(self, sample, timestep, prev_timestep, model_output):
# model_output -> e_θ(x_t, t)
# prev_sample -> x_(t−δ)
alpha_prod_t = self.alphas_cumprod[timestep]
alpha_prod_t_prev = self.alphas_cumprod[prev_timestep] if prev_timestep >= 0 else self.final_alpha_cumprod
torch.where(prev_timestep >= 0, torch.index_select(self.alphas_cumprod, 0, prev_timestep), self.final_alpha_cumprod)
beta_prod_t = 1 - alpha_prod_t
beta_prod_t_prev = 1 - alpha_prod_t_prev

Expand Down

0 comments on commit 22fbaf4

Please sign in to comment.