Skip to content

Commit

Permalink
merge hyper connection streams before final norm, to avoid edge case …
Browse files Browse the repository at this point in the history
…with adaptive layernorm
  • Loading branch information
lucidrains committed Dec 24, 2024
1 parent 003275c commit e1be411
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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 = 'x-transformers',
packages = find_packages(exclude=['examples']),
version = '1.43.2',
version = '1.43.4',
license='MIT',
description = 'X-Transformers - Pytorch',
author = 'Phil Wang',
Expand Down
10 changes: 5 additions & 5 deletions x_transformers/x_transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2270,16 +2270,16 @@ def forward(
if self.need_condition:
final_norm = maybe(partial)(final_norm, **norm_kwargs)

if self.resi_dual:
x = x + final_norm(outer_residual)
else:
x = final_norm(x)

# take care of multistreams if needed, use sum for now

if is_multistream:
x = reduce(x, '(b s) n d -> b n d', 'sum', s = streams)

if self.resi_dual:
x = x + final_norm(outer_residual)
else:
x = final_norm(x)

if not return_hiddens:
return x

Expand Down

0 comments on commit e1be411

Please sign in to comment.