(self, x)
| 113 | self.mlp = MlpBlock(in_dim, mlp_dim, in_dim, dropout_rate) |
| 114 | |
| 115 | def forward(self, x): |
| 116 | residual = x |
| 117 | out = self.norm1(x) |
| 118 | out = self.attn(out) |
| 119 | if self.dropout: |
| 120 | out = self.dropout(out) |
| 121 | out += residual |
| 122 | residual = out |
| 123 | |
| 124 | out = self.norm2(out) |
| 125 | out = self.mlp(out) |
| 126 | out += residual |
| 127 | return out |
| 128 | |
| 129 | |
| 130 | class Encoder(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected