Skip to content

Commit aed2b0e

Browse files
committed
Replace undefined variable x with input in torch_rotary_position_embedding
1 parent 4f7d4d2 commit aed2b0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rotary_position_embedding.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def torch_rotary_position_embedding(input, sin_table, cos_table, interleaved=Tru
2121

2222
return torch.stack((input_0_rotated, input_1_rotated), dim=-1).view(input.shape)
2323
else:
24-
input_0 = x[..., : x.shape[-1] // 2]
25-
input_1 = x[..., x.shape[-1] // 2 :]
24+
input_0 = input[..., : input.shape[-1] // 2]
25+
input_1 = input[..., input.shape[-1] // 2 :]
2626
input_0_rotated = input_0 * cos_table - input_1 * sin_table
2727
input_1_rotated = input_0 * sin_table + input_1 * cos_table
2828

0 commit comments

Comments
 (0)