Skip to content

Commit

Permalink
fix bug with einops
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Mar 4, 2021
1 parent c421f9f commit 3088a2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 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 = 'transformer-in-transformer',
packages = find_packages(),
version = '0.0.3',
version = '0.0.4',
license='MIT',
description = 'Transformer in Transformer - Pytorch',
author = 'Phil Wang',
Expand Down
2 changes: 1 addition & 1 deletion transformer_in_transformer/tnt.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __init__(
self.patch_tokens = nn.Parameter(torch.randn(num_patch_tokens + 1, patch_dim))

self.to_pixel_tokens = nn.Sequential(
Rearrange('b c (p1 h) (p2 w) -> (b h w) c p1 p2', p1 = patch_size, p2 = patch_size),
Rearrange('b c (h p1) (w p2) -> (b h w) c p1 p2', p1 = patch_size, p2 = patch_size),
nn.Unfold(pixel_width, stride = pixel_width),
Rearrange('... c n -> ... n c'),
nn.Linear(3 * pixel_width ** 2, pixel_dim)
Expand Down

0 comments on commit 3088a2d

Please sign in to comment.