aboutsummaryrefslogtreecommitdiff
path: root/extensions-builtin/Lora/network_glora.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2024-01-01 16:39:51 +0300
committerGitHub <noreply@github.com>2024-01-01 16:39:51 +0300
commitdfd64382211317cc46ad337c373492bfc420fa18 (patch)
tree3b1b2f5f3648da07430f54d1c155ce379a6fa3f7 /extensions-builtin/Lora/network_glora.py
parent3d15e58b0a30f2ef1e731f9e429f4d3cf1c259c5 (diff)
parent0ce67cb61806cf43f4d726d4705a4f6fdc2540e6 (diff)
Merge branch 'dev' into feat/interrupted-end
Diffstat (limited to 'extensions-builtin/Lora/network_glora.py')
-rw-r--r--extensions-builtin/Lora/network_glora.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/extensions-builtin/Lora/network_glora.py b/extensions-builtin/Lora/network_glora.py
index 492d4870..efe5c681 100644
--- a/extensions-builtin/Lora/network_glora.py
+++ b/extensions-builtin/Lora/network_glora.py
@@ -22,12 +22,12 @@ class NetworkModuleGLora(network.NetworkModule):
self.w2b = weights.w["b2.weight"]
def calc_updown(self, orig_weight):
- w1a = self.w1a.to(orig_weight.device, dtype=orig_weight.dtype)
- w1b = self.w1b.to(orig_weight.device, dtype=orig_weight.dtype)
- w2a = self.w2a.to(orig_weight.device, dtype=orig_weight.dtype)
- w2b = self.w2b.to(orig_weight.device, dtype=orig_weight.dtype)
+ w1a = self.w1a.to(orig_weight.device)
+ w1b = self.w1b.to(orig_weight.device)
+ w2a = self.w2a.to(orig_weight.device)
+ w2b = self.w2b.to(orig_weight.device)
output_shape = [w1a.size(0), w1b.size(1)]
- updown = ((w2b @ w1b) + ((orig_weight @ w2a) @ w1a))
+ updown = ((w2b @ w1b) + ((orig_weight.to(dtype = w1a.dtype) @ w2a) @ w1a))
return self.finalize_updown(updown, orig_weight, output_shape)