fixed missing closing bracket

This commit is contained in:
shawnington 2024-06-03 12:57:46 -07:00 committed by GitHub
parent 938f824aae
commit 438b1ea399
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -260,7 +260,7 @@ def attention_split(q, k, v, heads, mask=None, attn_precision=None):
end = i + slice_size
if upcast:
with torch.autocast(enabled=False, device_type = 'cuda'):
s1 = einsum('b i d, b j d -> b i j', q[:, i:end].to(dtype=torch.float32), k.to(dtype=torch.float32) * scale
s1 = einsum('b i d, b j d -> b i j', q[:, i:end].to(dtype=torch.float32), k.to(dtype=torch.float32)) * scale
else:
s1 = einsum('b i d, b j d -> b i j', q[:, i:end], k) * scale