mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
directly convert list to tensor
This commit is contained in:
parent
b681a8f4f2
commit
ba1124b326
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user