From 23a89ca4c57024a5fa18da9b4eb58eee2a525f4f Mon Sep 17 00:00:00 2001 From: digital-garbage <133010426+digital-garbage@users.noreply.github.com> Date: Thu, 5 Nov 2026 15:30:20 +0200 Subject: [PATCH] Test: noise merging follows the first noise's device (meta stand-in) --- modules/sampling/noise_merge/tests/test_noise_merge.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/sampling/noise_merge/tests/test_noise_merge.py b/modules/sampling/noise_merge/tests/test_noise_merge.py index 41f8770c..e0cf1efa 100644 --- a/modules/sampling/noise_merge/tests/test_noise_merge.py +++ b/modules/sampling/noise_merge/tests/test_noise_merge.py @@ -187,3 +187,9 @@ def test_mixed_noise_follows_the_dtype_and_device_of_the_noise_it_meets(): a = torch.randn(2, 3, dtype=dtype) out = mix_noise(a, torch.randn(2, 3, dtype=torch.float32), 0.3) assert out.dtype == dtype and out.device == a.device + + +def test_mixed_noise_brings_the_other_noise_to_the_first_ones_device(): + from modules.sampling.noise_merge import mix_noise + out = mix_noise(torch.empty(2, 3, device="meta"), torch.randn(2, 3), 0.3) # a meta noise stands in for another device + assert out.device.type == "meta" and out.dtype == torch.float32