diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-01-08 13:16:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-08 13:16:31 +0000 |
commit | 0d194e4ecc97c4a9a7851af6ce8688f09dc94222 (patch) | |
tree | 96b2158e9968233c453535051e2501758dea30a9 | |
parent | a479e08be1af1ae432b2379e2e99850dd7b23c96 (diff) | |
parent | df3b31eb559ab9fabf7e513bdeddd5282c16f124 (diff) | |
download | stable-diffusion-webui-gfx803-0d194e4ecc97c4a9a7851af6ce8688f09dc94222.tar.gz stable-diffusion-webui-gfx803-0d194e4ecc97c4a9a7851af6ce8688f09dc94222.tar.bz2 stable-diffusion-webui-gfx803-0d194e4ecc97c4a9a7851af6ce8688f09dc94222.zip |
Merge pull request #6465 from brkirch/fix-training
Fix training for newer PyTorch builds
-rw-r--r-- | modules/sd_hijack_clip.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/sd_hijack_clip.py b/modules/sd_hijack_clip.py index 5520c9b2..852afc66 100644 --- a/modules/sd_hijack_clip.py +++ b/modules/sd_hijack_clip.py @@ -247,9 +247,9 @@ class FrozenCLIPEmbedderWithCustomWordsBase(torch.nn.Module): # restoring original mean is likely not correct, but it seems to work well to prevent artifacts that happen otherwise
batch_multipliers = torch.asarray(batch_multipliers).to(devices.device)
original_mean = z.mean()
- z *= batch_multipliers.reshape(batch_multipliers.shape + (1,)).expand(z.shape)
+ z = z * batch_multipliers.reshape(batch_multipliers.shape + (1,)).expand(z.shape)
new_mean = z.mean()
- z *= original_mean / new_mean
+ z = z * (original_mean / new_mean)
return z
|