MCPcopy Create free account
hub / github.com/KohakuBlueleaf/LyCORIS / custom_state_dict

Method custom_state_dict

lycoris/modules/locon.py:262–271  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

260 ratio = desired.cpu() / norm.cpu()
261
262 scaled = norm != desired
263 if scaled:
264 self.scalar *= ratio
265
266 return scaled, orig_norm * ratio
267
268 def bypass_forward_diff(self, x, scale=1):
269 if self.rank_dropout and self.training:
270 # The mask lives on the r axis between down and up, so this case
271 # keeps the chain split; every other case is one dispatched call.
272 if self.module_type == "linear":
273 mid = F.linear(x, self.lora_down.weight.to(x))
274 elif self.tucker:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected