(self)
| 161 | return prompts |
| 162 | |
| 163 | def forward(self): |
| 164 | |
| 165 | ctx = self.ctx |
| 166 | ctx_vision = self.ctx_vision |
| 167 | if ctx.dim() == 2: |
| 168 | ctx = ctx.unsqueeze(0).expand(self.n_cls, -1, -1) |
| 169 | |
| 170 | prefix = self.token_prefix |
| 171 | suffix = self.token_suffix |
| 172 | prompts = self.construct_prompts(ctx, prefix, suffix) |
| 173 | |
| 174 | return prompts, ctx_vision # pass here original, as for visual 768 is required |
| 175 | |
| 176 | |
| 177 | class CustomCLIP(nn.Module): |
nothing calls this directly
no test coverage detected