MCPcopy Create free account
hub / github.com/CompVis/diff2flow / forward

Method forward

diff2flow/lora.py:109–118  ·  view source on GitHub ↗

Args: x (torch.Tensor): In shape of (B, C, H, W)

(self, x)

Source from the content-addressed store, hash-verified

107 nn.init.kaiming_normal_(self.A.weight, a=1)
108
109 def forward(self, x):
110 """
111 Args:
112 x (torch.Tensor): In shape of (B, C, H, W)
113 """
114 w_out = self.W(x)
115 a_out = self.A(x)
116 b_out = self.B(a_out)
117
118 return w_out + b_out * self.lora_scale
119
120
121class LoRAAdapterConv(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected