(self, x, return_attention=False)
| 104 | self.mlp = Mlp(in_features=dim, hidden_features=mlp_hidden_dim, act_layer=act_layer, drop=drop) |
| 105 | |
| 106 | def forward(self, x, return_attention=False): |
| 107 | y, attn = self.attn(self.norm1(x)) |
| 108 | x = x + self.drop_path(y) |
| 109 | x = x + self.drop_path(self.mlp(self.norm2(x))) |
| 110 | |
| 111 | if return_attention: |
| 112 | return x, attn |
| 113 | else: |
| 114 | return x |
| 115 | |
| 116 | |
| 117 | class PatchEmbed(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected