Skip to content

Commit 1bb14f8

Browse files
authored
fix torchao version check on torch version (#2918)
Summary: Fix error in #2908. The version string for PyTorch 2.8 reads "2.8.0...", so we need to compare `>= 2.9` to properly gate out PyTorch 2.9. Test Plan: 1. make this change in a locally installed __init__ file of torchao downloaded via pip 2. install PyTorch 2.8.0 3. import torchao, verify warning was not hit Reviewers: Subscribers: Tasks: Tags:
1 parent ffabe80 commit 1bb14f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchao/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# dumped)".
3636
# TODO(#2901, and before next torchao release): make this generic for
3737
# future torchao and torch versions
38-
if __version__.startswith("0.13.0") and torch.__version__ > "2.8":
38+
if __version__.startswith("0.13.0") and torch.__version__ >= "2.9":
3939
logger.warning(
4040
f"Skipping import of cpp extensions due to incompatible torch version {torch.__version__} for torchao version {__version__}"
4141
)

0 commit comments

Comments
 (0)