MCPcopy Create free account
hub / github.com/Francis-Rings/MotionFollower / __init__

Method __init__

src/models/motion_module.py:280–303  ·  view source on GitHub ↗
(
        self,
        attention_mode=None,
        cross_frame_attention_mode=None,
        temporal_position_encoding=False,
        temporal_position_encoding_max_len=24,
        *args,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

278
279class VersatileAttention(Attention):
280 def __init__(
281 self,
282 attention_mode=None,
283 cross_frame_attention_mode=None,
284 temporal_position_encoding=False,
285 temporal_position_encoding_max_len=24,
286 *args,
287 **kwargs,
288 ):
289 super().__init__(*args, **kwargs)
290 assert attention_mode == "Temporal"
291
292 self.attention_mode = attention_mode
293 self.is_cross_attention = kwargs["cross_attention_dim"] is not None
294
295 self.pos_encoder = (
296 PositionalEncoding(
297 kwargs["query_dim"],
298 dropout=0.0,
299 max_len=temporal_position_encoding_max_len,
300 )
301 if (temporal_position_encoding and attention_mode == "Temporal")
302 else None
303 )
304
305 def extra_repr(self):
306 return f"(Module Info) Attention_Mode: {self.attention_mode}, Is_Cross_Attention: {self.is_cross_attention}"

Callers

nothing calls this directly

Calls 2

PositionalEncodingClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected