Skip to content

Commit

Permalink
Merge pull request #314 from dev-jinwoohong/develop
Browse files Browse the repository at this point in the history
Fix scale calculation in attention mechanism
  • Loading branch information
lucidrains authored May 17, 2024
2 parents 9c20670 + e875f37 commit 356d7ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion denoising_diffusion_pytorch/attend.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def flash_attn(self, q, k, v):

if exists(self.scale):
default_scale = q.shape[-1]
q = q * (scale / default_scale)
q = q * (self.scale / default_scale)

q, k, v = map(lambda t: t.contiguous(), (q, k, v))

Expand Down

0 comments on commit 356d7ee

Please sign in to comment.