MCPcopy Create free account
hub / github.com/360CVGroup/FancyVideo / forward

Method forward

fancyvideo/models/motion_module.py:213–225  ·  view source on GitHub ↗
(self, hidden_states, encoder_hidden_states=None, attention_mask=None, video_length=None)

Source from the content-addressed store, hash-verified

211
212
213 def forward(self, hidden_states, encoder_hidden_states=None, attention_mask=None, video_length=None):
214 for attention_block, norm in zip(self.attention_blocks, self.norms):
215 norm_hidden_states = norm(hidden_states)
216 hidden_states = attention_block(
217 norm_hidden_states,
218 encoder_hidden_states=encoder_hidden_states if attention_block.is_cross_attention else None,
219 video_length=video_length,
220 ) + hidden_states
221
222 hidden_states = self.ff(self.ff_norm(hidden_states)) + hidden_states
223
224 output = hidden_states
225 return output
226
227
228class PositionalEncoding(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected