(self)
| 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: |
nothing calls this directly
no outgoing calls
no test coverage detected