mstar.model.vjepa2.components.rope_utils#
3D rotary position embedding helpers for V-JEPA 2.
Ported verbatim from HuggingFace transformers/models/vjepa2/modeling_vjepa2.py
and upstream vjepa2/src/models/utils/modules.py. Both copies share the
same frequency schedule and the same “duplicate then rotate adjacent pair”
construction noted in the upstream comment as a pretraining-compatibility
quirk. Do not “fix” the .repeat(…, 2) to .repeat_interleave(2) — it
would break the pretrained weights.
Functions
|
|
|
|
|
Apply rotary embeddings along the last |
Classes
|
One cached step's |
- class mstar.model.vjepa2.components.rope_utils.RopeTables(spatial, time)[source]#
Bases:
NamedTupleOne cached step’s
(sin, cos)(ACRoPEAttention.rope_tables): built once from the step’s positions and shared by every block, q and k.
- mstar.model.vjepa2.components.rope_utils.rope_tables_BNHD(pos, dim, dtype, device)[source]#
(sin, cos)forapply_rope_BNHDover the lastdimdims.