(self, t, start_index = 0)
| 84 | print('======== shape of rope freq', self.freqs_cos.shape, '========') |
| 85 | |
| 86 | def forward(self, t, start_index = 0): |
| 87 | rot_dim = self.freqs_cos.shape[-1] |
| 88 | end_index = start_index + rot_dim |
| 89 | assert rot_dim <= t.shape[-1], f'feature dimension {t.shape[-1]} is not of sufficient size to rotate in all the positions {rot_dim}' |
| 90 | t_left, t, t_right = t[..., :start_index], t[..., start_index:end_index], t[..., end_index:] |
| 91 | t = (t * self.freqs_cos) + (rotate_half(t) * self.freqs_sin) |
| 92 | return torch.cat((t_left, t, t_right), dim = -1) |
| 93 | |
| 94 | |
| 95 |
nothing calls this directly
no test coverage detected