[Mypy] Part 3 fix typing for nested directories for most of directory (#4161)

This commit is contained in:
SangBin Cho
2024-04-22 21:32:44 -07:00
committed by GitHub
parent 34128a697e
commit 0ae11f78ab
29 changed files with 126 additions and 88 deletions
@@ -108,7 +108,8 @@ class RotaryEmbedding(nn.Module):
query_pass = query[..., self.rotary_dim:]
key_pass = key[..., self.rotary_dim:]
self.cos_sin_cache = self.cos_sin_cache.to(positions.device)
self.cos_sin_cache: torch.Tensor = self.cos_sin_cache.to(
positions.device)
cos_sin = self.cos_sin_cache[torch.add(positions, offsets)
if offsets is not None else positions]
cos, sin = cos_sin.chunk(2, dim=-1)