Commit 96656b93 authored by Alexander Ploshkin's avatar Alexander Ploshkin
Browse files

Remove redundant shape asserts in rotary embeddings

parent 04c4c610
......@@ -43,8 +43,6 @@ class ApplyRotaryEmb(torch.autograd.Function):
rotary_dim *= 2
assert rotary_dim <= headdim
assert seqlen <= rotary_seqlen
assert cos.shape == (rotary_seqlen, rotary_dim // 2)
assert sin.shape == (rotary_seqlen, rotary_dim // 2)
x1, x2 = x[..., :rotary_dim].chunk(2, dim=-1)
out = torch.empty_like(x) if not inplace else x
o1, o2 = out[..., :rotary_dim].chunk(2, dim=-1) if not inplace else (x1, x2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment