Commit c9de109
authored
🚨 Refactor ViT to updated standards (#41693)
* refactor attention
* use mlp instead of intermediate and output
* use modular for deit
* nit
* fix deit (to check) and refactor beit
* use modular for beit
* style
* refactor vit deit beit segformer
* add pos_embed_utils, refactor swin
* Fix after merge + refactor pixio
* refactor most drop_path in transformers
* refactor vit_msn
* fix modular
* refactor vivit and audio_spectrogram_transformer, remove obsolete copied from and add todos
* Fix repo
* fix nit
* Fix drop_path_schedule
* nit
* use modular for pos embed
* reverse DropPath as a util
* add conversion ijepa + fix offload vit_mae
* fix modular
* fix qkv bias in output proj + swin attention per stage
* address review comments
* fix swinn
* improve swin and beit
* last fixes after review
* standardize backbone beit
* fix beit
* fix beit
* fix repo
* changes after review
* Fix beit
* fix after review
* fix unexpected key swin
* Address review
* fix repo
* Fix after review
* fix modular
* fix depth pro
* Fix conversion mappings
* fix style
* Fix failing tests
* fix ci
* Fix two slow failing tests1 parent 381032b commit c9de109
106 files changed
Lines changed: 9314 additions & 5605 deletions
File tree
- docs/source/en
- src/transformers
- loss
- models
- aimv2
- audio_spectrogram_transformer
- beit
- bit
- clap
- conditional_detr
- convnextv2
- convnext
- cvt
- d_fine
- dab_detr
- data2vec
- deimv2
- deit
- dinat
- dinov2_with_registers
- dinov2
- dinov3_convnext
- dinov3_vit
- donut
- dpt
- eomt_dinov3
- eomt
- flava
- florence2
- focalnet
- git
- glpn
- grounding_dino
- hiera
- ijepa
- lw_detr
- maskformer
- mgp_str
- mm_grounding_dino
- pixio
- poolformer
- pp_doclayout_v2
- pp_doclayout_v3
- pp_lcnet_v3
- pp_lcnet
- pp_ocrv5_mobile_rec
- pp_ocrv5_server_rec
- pvt_v2
- pvt
- qianfan_ocr
- resnet
- rf_detr
- rt_detr_v2
- rt_detr
- segformer
- seggpt
- slanet
- swiftformer
- swin2sr
- swinv2
- swin
- timesformer
- uvdoc
- videomae
- videomt
- vilt
- vit_mae
- vit_msn
- vitdet
- vitpose_backbone
- vit
- vivit
- vjepa2
- x_clip
- yolos
- zamba2
- utils
- tests
- models
- beit
- conditional_detr
- depth_pro
- detr
- segformer
- swin
- vit_mae
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
97 | 96 | | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
107 | 115 | | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
112 | 209 | | |
113 | 210 | | |
114 | 211 | | |
| |||
548 | 645 | | |
549 | 646 | | |
550 | 647 | | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
551 | 659 | | |
552 | 660 | | |
553 | 661 | | |
| |||
836 | 944 | | |
837 | 945 | | |
838 | 946 | | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
839 | 961 | | |
840 | 962 | | |
841 | 963 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
147 | 170 | | |
| 171 | + | |
148 | 172 | | |
149 | 173 | | |
150 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
116 | 164 | | |
117 | 165 | | |
118 | 166 | | |
| |||
128 | 176 | | |
129 | 177 | | |
130 | 178 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | 179 | | |
149 | 180 | | |
150 | 181 | | |
151 | 182 | | |
152 | 183 | | |
153 | 184 | | |
154 | | - | |
155 | | - | |
156 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
157 | 188 | | |
158 | 189 | | |
159 | 190 | | |
160 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
161 | 197 | | |
162 | 198 | | |
163 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | 168 | | |
185 | 169 | | |
186 | 170 | | |
187 | 171 | | |
188 | 172 | | |
189 | 173 | | |
190 | | - | |
191 | | - | |
192 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
193 | 177 | | |
194 | 178 | | |
195 | 179 | | |
196 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
197 | 186 | | |
198 | 187 | | |
199 | 188 | | |
| |||
0 commit comments