Skip to content

Commit

Permalink
fall in line with trim logic in enformer master
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Jun 1, 2022
1 parent dcb5751 commit f881928
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions enformer_pytorch/modeling_enformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ def forward(self, x):
raise ValueError(f'sequence length {seq_len} is less than target length {target_len}')

trim = (target_len - seq_len) // 2

if trim == 0:
return x

return x[:, -trim:trim]

def ConvBlock(dim, dim_out = None, kernel_size = 1):
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 = 'enformer-pytorch',
packages = find_packages(exclude=[]),
include_package_data = True,
version = '0.4.6',
version = '0.4.7',
license='MIT',
description = 'Enformer - Pytorch',
author = 'Phil Wang',
Expand Down

0 comments on commit f881928

Please sign in to comment.