microsoft / Swin-Transformer

This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows".
https://arxiv.org/abs/2103.14030
MIT License
13.96k stars 2.06k forks source link

Flops computation for swin transformer #340

Open ChaojifeixiaDazhuang opened 1 year ago

ChaojifeixiaDazhuang commented 1 year ago

Hi all, as title described, in the view of engineering and chip, one MAC(Multiply Accumulate) equals two Ops. So the flops computation for Convolution, MatMul, Linear should multiply to 2,which as changed here. Thus, for the swin-v1-tiny, the whole Flops should be 9GFlops.

### Tasks
- [ ] https://github.com/microsoft/Swin-Transformer/pull/339