(self, x)
| 146 | nn.Linear(int(dim * mlp_ratio), dim), nn.Dropout(proj_dropout)) |
| 147 | |
| 148 | def forward(self, x): |
| 149 | if self.post_norm: |
| 150 | x = x + self.norm1(self.attn(x)) |
| 151 | x = x + self.norm2(self.mlp(x)) |
| 152 | else: |
| 153 | x = x + self.attn(self.norm1(x)) |
| 154 | x = x + self.mlp(self.norm2(x)) |
| 155 | return x |
| 156 | |
| 157 | |
| 158 | class AttentionPool(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected