Skip to content

Commit

Permalink
remove reuse of reindexing mask
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Oct 22, 2020
1 parent f04d1d2 commit cee78ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions gsa_pytorch/gsa_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ def forward(self, img):

Yh = self.norm(Yh)

Iy = Ix if x == y else None
Iy = default(Iy, lambda: calc_reindexing_tensor(y, L, device))

Iy = calc_reindexing_tensor(y, L, device)
Py = einsum('yir,rd->yid', Iy, self.rel_columns)
Sy = einsum('ndxy,yid->nixy', q, Py)
rel_pos_out = einsum('nixy,nexi->nexy', Sy, Yh)
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 = 'gsa-pytorch',
packages = find_packages(),
version = '0.2.0',
version = '0.2.1',
license='MIT',
description = 'Global Self-attention Network (GSA) - Pytorch',
author = 'Phil Wang',
Expand Down

0 comments on commit cee78ea

Please sign in to comment.