MCPcopy Create free account
hub / github.com/MatrixTeam-AI/RAIN / forward

Method forward

src/models/motion_module.py:236–259  ·  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

234 self.ff_norm = nn.LayerNorm(dim)
235
236 def forward(
237 self,
238 hidden_states,
239 encoder_hidden_states=None,
240 attention_mask=None,
241 video_length=None,
242 ):
243 for attention_block, norm in zip(self.attention_blocks, self.norms):
244 norm_hidden_states = norm(hidden_states)
245 hidden_states = (
246 attention_block(
247 norm_hidden_states,
248 encoder_hidden_states=encoder_hidden_states
249 if attention_block.is_cross_attention
250 else None,
251 video_length=video_length,
252 )
253 + hidden_states
254 )
255
256 hidden_states = self.ff(self.ff_norm(hidden_states)) + hidden_states
257
258 output = hidden_states
259 return output
260
261
262class PositionalEncoding(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected