Skip to content

Commit 2eccd8b

Browse files
authored
Add the missing negative sign in the formula.
1 parent df566e0 commit 2eccd8b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

labml_nn/transformers/rope/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def _build_cache(self, x: torch.Tensor):
137137
# Get sequence length
138138
seq_len = x.shape[0]
139139

140-
# $\Theta = {\theta_i = 10000^{\frac{2(i-1)}{d}}, i \in [1, 2, ..., \frac{d}{2}]}$
140+
# $\Theta = {\theta_i = 10000^{-\frac{2(i-1)}{d}}, i \in [1, 2, ..., \frac{d}{2}]}$
141141
theta = 1. / (self.base ** (torch.arange(0, self.d, 2).float() / self.d)).to(x.device)
142142

143143
# Create position indexes `[0, 1, ..., seq_len - 1]`

0 commit comments

Comments
 (0)