(self, attn: Attention, hidden_states: torch.FloatTensor, *args, **kwargs)
| 1754 | self.to_out_lora = LoRALinearLayer(out_hidden_size, out_hidden_size, out_rank, network_alpha) |
| 1755 | |
| 1756 | def __call__(self, attn: Attention, hidden_states: torch.FloatTensor, *args, **kwargs) -> torch.FloatTensor: |
| 1757 | self_cls_name = self.__class__.__name__ |
| 1758 | deprecate( |
| 1759 | self_cls_name, |
| 1760 | "0.26.0", |
| 1761 | ( |
| 1762 | f"Make sure use {self_cls_name[4:]} instead by setting" |
| 1763 | "LoRA layers to `self.{to_q,to_k,to_v,to_out[0]}.lora_layer` respectively. This will be done automatically when using" |
| 1764 | " `LoraLoaderMixin.load_lora_weights`" |
| 1765 | ), |
| 1766 | ) |
| 1767 | attn.to_q.lora_layer = self.to_q_lora.to(hidden_states.device) |
| 1768 | attn.to_k.lora_layer = self.to_k_lora.to(hidden_states.device) |
| 1769 | attn.to_v.lora_layer = self.to_v_lora.to(hidden_states.device) |
| 1770 | attn.to_out[0].lora_layer = self.to_out_lora.to(hidden_states.device) |
| 1771 | |
| 1772 | attn._modules.pop("processor") |
| 1773 | attn.processor = AttnProcessor() |
| 1774 | return attn.processor(attn, hidden_states, *args, **kwargs) |
| 1775 | |
| 1776 | |
| 1777 | class LoRAAttnProcessor2_0(nn.Module): |
nothing calls this directly
no test coverage detected