Skip to content

Commit

Permalink
1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Nov 12, 2021
1 parent a34d5d9 commit ae4d88a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dalle_pytorch/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def max_neg_value(t):

def stable_softmax(t, dim = -1, alpha = 32 ** 2):
t = t / alpha
t = t - torch.amax(t, dim = dim, keepdim = True)
t = t - torch.amax(t, dim = dim, keepdim = True).detach()
return (t * alpha).softmax(dim = dim)

def apply_pos_emb(pos_emb, qkv):
Expand Down
2 changes: 1 addition & 1 deletion dalle_pytorch/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, dim):
self.dim = dim

def forward(self, x):
maxes = x.amax(dim = self.dim, keepdim = True)
maxes = x.amax(dim = self.dim, keepdim = True).detach()
return x / maxes

# https://arxiv.org/abs/2103.17239
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name = 'dalle-pytorch',
packages = find_packages(),
include_package_data = True,
version = '1.1.2',
version = '1.1.4',
license='MIT',
description = 'DALL-E - Pytorch',
author = 'Phil Wang',
Expand Down

0 comments on commit ae4d88a

Please sign in to comment.