MCPcopy Create free account
hub / github.com/CompVis/zigma / forward

Method forward

model_zigma.py:215–224  ·  view source on GitHub ↗
(self, caption, train, force_drop_ids=None)

Source from the content-addressed store, hash-verified

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#################################################################################

Callers

nothing calls this directly

Calls 1

token_dropMethod · 0.95

Tested by

no test coverage detected