mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-29 07:22:12 +03:00
clamp comment @sayakpaul
This commit is contained in:
committed by
Daniel Gu
parent
edd9ad88d8
commit
bd51557816
@@ -214,6 +214,8 @@ class DDPMScheduler(SchedulerMixin, ConfigMixin):
|
||||
# and sample from it to get previous sample
|
||||
# x_{t-1} ~ N(pred_prev_sample, variance) == add variance to pred_sample
|
||||
variance = (1 - alpha_prod_t_prev) / (1 - alpha_prod_t) * current_beta_t
|
||||
|
||||
# we always take the log of variance, so clamp it to ensure it's not 0
|
||||
variance = torch.clamp(variance, min=1e-20)
|
||||
|
||||
if variance_type is None:
|
||||
|
||||
Reference in New Issue
Block a user