MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / FeedForward

Function FeedForward

wan/models/portrait_encoder.py:9–16  ·  view source on GitHub ↗
(dim, mult=4)

Source from the content-addressed store, hash-verified

7from diffusers.models.modeling_utils import ModelMixin
8
9def FeedForward(dim, mult=4):
10 inner_dim = int(dim * mult)
11 return nn.Sequential(
12 nn.LayerNorm(dim),
13 nn.Linear(dim, inner_dim, bias=False),
14 nn.GELU(),
15 nn.Linear(inner_dim, dim, bias=False),
16 )
17
18
19def reshape_tensor(x, heads):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected