Skip to content

Commit

Permalink
enforce latest einops
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed May 8, 2023
1 parent e1b08c1 commit ad4ca19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'vit-pytorch',
packages = find_packages(exclude=['examples']),
version = '1.2.0',
version = '1.2.1',
license='MIT',
description = 'Vision Transformer (ViT) - Pytorch',
long_description_content_type = 'text/markdown',
Expand All @@ -16,7 +16,7 @@
'image recognition'
],
install_requires=[
'einops>=0.6.0',
'einops>=0.6.1',
'torch>=1.10',
'torchvision'
],
Expand Down
7 changes: 7 additions & 0 deletions vit_pytorch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import torch
from packaging import version

if version.parse(torch.__version__) >= version.parse('2.0.0'):
from einops._torch_specific import allow_ops_in_compiled_graph
allow_ops_in_compiled_graph()

from vit_pytorch.vit import ViT
from vit_pytorch.simple_vit import SimpleViT

Expand Down

0 comments on commit ad4ca19

Please sign in to comment.