MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / forward

Method forward

diffusers/src/diffusers/models/lora.py:286–296  ·  view source on GitHub ↗
(self, hidden_states: torch.Tensor)

Source from the content-addressed store, hash-verified

284 nn.init.zeros_(self.up.weight)
285
286 def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
287 orig_dtype = hidden_states.dtype
288 dtype = self.down.weight.dtype
289
290 down_hidden_states = self.down(hidden_states.to(dtype))
291 up_hidden_states = self.up(down_hidden_states)
292
293 if self.network_alpha is not None:
294 up_hidden_states *= self.network_alpha / self.rank
295
296 return up_hidden_states.to(orig_dtype)
297
298
299class LoRACompatibleConv(nn.Conv2d):

Callers

nothing calls this directly

Calls 1

toMethod · 0.45

Tested by

no test coverage detected