(self, caption, train, force_drop_ids=None)
| 213 | return caption |
| 214 | |
| 215 | def forward(self, caption, train, force_drop_ids=None): |
| 216 | if train: |
| 217 | assert ( |
| 218 | caption.shape[1:] == self.y_embedding.shape |
| 219 | ), f"{caption.shape} is not {self.y_embedding.shape}" |
| 220 | use_dropout = self.uncond_prob > 0 |
| 221 | if (train and use_dropout) or (force_drop_ids is not None): |
| 222 | caption = self.token_drop(caption, force_drop_ids) |
| 223 | caption = self.y_proj(caption) |
| 224 | return caption |
| 225 | |
| 226 | |
| 227 | ################################################################################# |
nothing calls this directly
no test coverage detected