mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-17 11:50:18 +08:00
restore org_dtype != compute dtype case
This commit is contained in:
parent
b783a967c0
commit
310d0e6938
@ -391,7 +391,8 @@ def restore_weights_backup(obj, field, weight):
|
|||||||
setattr(obj, field, None)
|
setattr(obj, field, None)
|
||||||
return
|
return
|
||||||
|
|
||||||
getattr(obj, field).copy_(weight)
|
old_weight = getattr(obj, field)
|
||||||
|
old_weight.copy_(weight.to(dtype=old_weight.dtype))
|
||||||
|
|
||||||
|
|
||||||
def network_restore_weights_from_backup(self: Union[torch.nn.Conv2d, torch.nn.Linear, torch.nn.GroupNorm, torch.nn.LayerNorm, torch.nn.MultiheadAttention], cleanup=False):
|
def network_restore_weights_from_backup(self: Union[torch.nn.Conv2d, torch.nn.Linear, torch.nn.GroupNorm, torch.nn.LayerNorm, torch.nn.MultiheadAttention], cleanup=False):
|
||||||
|
Loading…
Reference in New Issue
Block a user