Unverified Commit c7469ebe authored by Uranus's avatar Uranus Committed by GitHub
Browse files

fix sde add noise typo (#3839)

* fix sde typo

* fix code style
parent 15001306
......@@ -276,7 +276,11 @@ class ScoreSdeVeScheduler(SchedulerMixin, ConfigMixin):
# Make sure sigmas and timesteps have the same device and dtype as original_samples
timesteps = timesteps.to(original_samples.device)
sigmas = self.discrete_sigmas.to(original_samples.device)[timesteps]
noise = torch.randn_like(original_samples) * sigmas[:, None, None, None]
noise = (
noise * sigmas[:, None, None, None]
if noise is not None
else torch.randn_like(original_samples) * sigmas[:, None, None, None]
)
noisy_samples = noise + original_samples
return noisy_samples
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment