From ce0f9887a35cd4dccf44765d36ad7975a269f350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Deltheil?= Date: Wed, 10 Jan 2024 16:34:59 +0100 Subject: [PATCH] test_schedulers: fix pyright error Due to changes in diffusers 0.25.0 --- tests/foundationals/latent_diffusion/test_schedulers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/foundationals/latent_diffusion/test_schedulers.py b/tests/foundationals/latent_diffusion/test_schedulers.py index 74ec637..088b578 100644 --- a/tests/foundationals/latent_diffusion/test_schedulers.py +++ b/tests/foundationals/latent_diffusion/test_schedulers.py @@ -82,7 +82,9 @@ def test_euler_diffusers(): sample = randn(1, 4, 32, 32) noise = randn(1, 4, 32, 32) - assert isclose(diffusers_scheduler.init_noise_sigma, refiners_scheduler.init_noise_sigma), "init_noise_sigma differ" + ref_init_noise_sigma = diffusers_scheduler.init_noise_sigma # type: ignore + assert isinstance(ref_init_noise_sigma, Tensor) + assert isclose(ref_init_noise_sigma, refiners_scheduler.init_noise_sigma), "init_noise_sigma differ" for step, timestep in enumerate(diffusers_scheduler.timesteps): diffusers_output = cast(Tensor, diffusers_scheduler.step(noise, timestep, sample).prev_sample) # type: ignore