Skip to content

Commit 1650f9d

Browse files
committed
push
1 parent 35c24b0 commit 1650f9d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

torchao/utils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
"TORCH_VERSION_AT_LEAST_2_3",
2323
"TORCH_VERSION_AT_LEAST_2_4",
2424
"TORCH_VERSION_AT_LEAST_2_5",
25+
26+
# Needs to be deprecated in the future
27+
"TORCH_VERSION_AFTER_2_2",
28+
"TORCH_VERSION_AFTER_2_3",
29+
"TORCH_VERSION_AFTER_2_4",
30+
"TORCH_VERSION_AFTER_2_5",
2531
]
2632

2733

@@ -301,3 +307,13 @@ def torch_version_at_least(min_version):
301307
TORCH_VERSION_AT_LEAST_2_4 = torch_version_at_least("2.4.0")
302308
TORCH_VERSION_AT_LEAST_2_3 = torch_version_at_least("2.3.0")
303309
TORCH_VERSION_AT_LEAST_2_2 = torch_version_at_least("2.2.0")
310+
311+
312+
## Deprecated, will be deleted in the future
313+
def _torch_version_at_least(min_version):
314+
return is_fbcode() or version("torch") >= min_version
315+
316+
TORCH_VERSION_AFTER_2_5 = _torch_version_at_least("2.5.0.dev")
317+
TORCH_VERSION_AFTER_2_4 = _torch_version_at_least("2.4.0.dev")
318+
TORCH_VERSION_AFTER_2_3 = _torch_version_at_least("2.3.0.dev")
319+
TORCH_VERSION_AFTER_2_2 = _torch_version_at_least("2.2.0.dev")

0 commit comments

Comments
 (0)