Skip to content

Commit 68db7f3

Browse files
Complexity-MLclaude
andcommitted
Fix test_model: apply_rotary_pos_emb renamed to apply_rotary
The function signature changed from (q, k, cos, sin) to (x, cos, sin). Update import and test to match current model code. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 212c82a commit 68db7f3

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tests/test_model.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
MoEMLP,
3030
DenseSwiGLUMLP,
3131
RotaryEmbedding,
32-
apply_rotary_pos_emb,
32+
apply_rotary,
3333
)
3434

3535

@@ -97,9 +97,10 @@ def test_output_shapes(self):
9797
def test_apply_rotary(self):
9898
rope = RotaryEmbedding(dim=32)
9999
cos, sin = rope(8)
100-
q = torch.randn(1, 4, 8, 32)
101-
k = torch.randn(1, 2, 8, 32)
102-
q_rot, k_rot = apply_rotary_pos_emb(q, k, cos, sin)
100+
q = torch.randn(8, 4, 32)
101+
k = torch.randn(8, 2, 32)
102+
q_rot = apply_rotary(q, cos, sin)
103+
k_rot = apply_rotary(k, cos, sin)
103104
assert q_rot.shape == q.shape
104105
assert k_rot.shape == k.shape
105106

0 commit comments

Comments
 (0)