From ba1124b326280202cb583bbdc669fb5303bbd3e3 Mon Sep 17 00:00:00 2001 From: xeonvs Date: Wed, 7 Sep 2022 20:40:32 +0200 Subject: [PATCH] directly convert list to tensor --- modules/sd_hijack.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/sd_hijack.py b/modules/sd_hijack.py index 9d0637bf..1084e248 100644 --- a/modules/sd_hijack.py +++ b/modules/sd_hijack.py @@ -232,10 +232,7 @@ class FrozenCLIPEmbedderWithCustomWords(torch.nn.Module): z = outputs.last_hidden_state # restoring original mean is likely not correct, but it seems to work well to prevent artifacts that happen otherwise - if torch.has_mps: - batch_multipliers = torch.asarray(np.array(batch_multipliers).astype('float32')).to(device) - else: - batch_multipliers = torch.asarray(np.array(batch_multipliers)).to(device) + batch_multipliers = torch.asarray(batch_multipliers).to(device) original_mean = z.mean() z *= batch_multipliers.reshape(batch_multipliers.shape + (1,)).expand(z.shape) new_mean = z.mean()