(self)
| 880 | return x |
| 881 | |
| 882 | def flops(self): |
| 883 | flops = 0 |
| 884 | H, W = self.input_resolution |
| 885 | # norm1 |
| 886 | flops += self.dim * H * W |
| 887 | # W-MSA/SW-MSA |
| 888 | flops += self.attn.flops(H, W) |
| 889 | # norm2 |
| 890 | flops += self.dim * H * W |
| 891 | # mlp |
| 892 | flops += self.mlp.flops(H,W) |
| 893 | print("LeWin:{%.2f}"%(flops/1e9)) |
| 894 | return flops |
| 895 | |
| 896 | |
| 897 | ######################################### |