Method
__init__
(self, dim, hidden_dim, dropout = 0.)
Source from the content-addressed store, hash-verified
| 30 | |
| 31 | class FeedForward(nn.Module): |
| 32 | def __init__(self, dim, hidden_dim, dropout = 0.): |
| 33 | super().__init__() |
| 34 | self.net = nn.Sequential( |
| 35 | nn.LayerNorm(dim), |
| 36 | nn.Linear(dim, hidden_dim), |
| 37 | nn.GELU(), |
| 38 | nn.Dropout(dropout), |
| 39 | nn.Linear(hidden_dim, dim), |
| 40 | nn.Dropout(dropout) |
| 41 | ) |
| 42 | def forward(self, x): |
| 43 | return self.net(x) |
| 44 | |
Callers
nothing calls this directly
Tested by
no test coverage detected