(vit_features, features, use_readout, start_index=1)
| 164 | |
| 165 | |
| 166 | def get_readout_oper(vit_features, features, use_readout, start_index=1): |
| 167 | if use_readout == "ignore": |
| 168 | readout_oper = [Slice(start_index)] * len(features) |
| 169 | elif use_readout == "add": |
| 170 | readout_oper = [AddReadout(start_index)] * len(features) |
| 171 | elif use_readout == "project": |
| 172 | readout_oper = [ |
| 173 | ProjectReadout(vit_features, start_index) for out_feat in features |
| 174 | ] |
| 175 | else: |
| 176 | assert ( |
| 177 | False |
| 178 | ), "wrong operation for readout token, use_readout can be 'ignore', 'add', or 'project'" |
| 179 | |
| 180 | return readout_oper |
| 181 | |
| 182 | |
| 183 | def _make_vit_b16_backbone( |
no test coverage detected