MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / __init__

Method __init__

sat/sgm/modules/attention.py:93–99  ·  view source on GitHub ↗
(self, dim, dim_out=None, mult=4, glu=False, dropout=0.0)

Source from the content-addressed store, hash-verified

91
92class FeedForward(nn.Module):
93 def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0.0):
94 super().__init__()
95 inner_dim = int(dim * mult)
96 dim_out = default(dim_out, dim)
97 project_in = nn.Sequential(nn.Linear(dim, inner_dim), nn.GELU()) if not glu else GEGLU(dim, inner_dim)
98
99 self.net = nn.Sequential(project_in, nn.Dropout(dropout), nn.Linear(inner_dim, dim_out))
100
101 def forward(self, x):
102 return self.net(x)

Callers

nothing calls this directly

Calls 3

defaultFunction · 0.70
GEGLUClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected