(target_module, new_weight)
| 55 | |
| 56 | |
| 57 | def update_decoder_weights(target_module, new_weight): |
| 58 | device = target_module.weight.device |
| 59 | with torch.no_grad(): |
| 60 | target_module.weight.copy_(new_weight) |
| 61 | |
| 62 | # dispatch to correct device |
| 63 | for name, module in target_module.named_modules(): |
| 64 | if "lora_" in name: |
| 65 | module.to(device) |
| 66 | |
| 67 | |
| 68 | def kaiming_uniform_init_lower_half(matrix: torch.tensor): |
nothing calls this directly
no outgoing calls
no test coverage detected