(self, x, mask=None)
| 109 | self.drop_path = DropPath(drop_path) if drop_path > 0.0 else nn.Identity() |
| 110 | |
| 111 | def forward(self, x, mask=None): |
| 112 | x = x + self.drop_path(self.attn(self.norm1(x), mask)) |
| 113 | x = x + self.drop_path(self.mlp(self.norm2(x))) |
| 114 | return x |
| 115 | |
| 116 | class TransformerEncoder(nn.Module): |
| 117 | def __init__(self, embed_dim, num_heads, num_layers, mlp_ratio=4.0, dropout=0.1): |
nothing calls this directly
no outgoing calls
no test coverage detected