Skip to content

Commit

Permalink
fix causal masking in sparse conv attention
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Feb 5, 2021
1 parent 503139a commit 40f4119
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dalle_pytorch/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ def forward(self, x, mask = None):

# mask image attention

mask = rearrange(img_seq, 'i -> () i ()') <= k_img_indices
q_img_indices = rearrange(img_seq, 'i -> () i ()')
mask = q_img_indices >= k_img_indices

# image can attend to all of text

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'dalle-pytorch',
packages = find_packages(),
version = '0.0.52',
version = '0.0.53',
license='MIT',
description = 'DALL-E - Pytorch',
author = 'Phil Wang',
Expand Down

0 comments on commit 40f4119

Please sign in to comment.