MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / GEGLU

Class GEGLU

diffsynth/models/sd_unet.py:20–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19
20class GEGLU(torch.nn.Module):
21
22 def __init__(self, dim_in, dim_out):
23 super().__init__()
24 self.proj = torch.nn.Linear(dim_in, dim_out * 2)
25
26 def forward(self, hidden_states):
27 hidden_states, gate = self.proj(hidden_states).chunk(2, dim=-1)
28 return hidden_states * torch.nn.functional.gelu(gate)
29
30
31class BasicTransformerBlock(torch.nn.Module):

Callers 3

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected