Merge pull request #15239 from AUTOMATIC1111/Fix-lora-bugs

Add missing .mean() back
This commit is contained in:
AUTOMATIC1111 2024-03-16 09:06:05 +03:00 committed by GitHub
commit d38b390ed4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -173,7 +173,7 @@ class NetworkModule:
orig_weight = orig_weight.to(updown) orig_weight = orig_weight.to(updown)
merged_scale1 = updown + orig_weight merged_scale1 = updown + orig_weight
dora_merged = ( dora_merged = (
merged_scale1 / merged_scale1(dim=self.dora_mean_dim, keepdim=True) * self.dora_scale merged_scale1 / merged_scale1.mean(dim=self.dora_mean_dim, keepdim=True) * self.dora_scale
) )
final_updown = dora_merged - orig_weight final_updown = dora_merged - orig_weight
return final_updown return final_updown