Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions tico/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,25 @@
from packaging.version import Version

from tico.config import CompileConfigV1, get_default_config

from tico.utils.convert import convert, convert_from_exported_program, convert_from_pt2

# THIS LINE IS AUTOMATICALLY GENERATED BY setup.py
__version__ = "0.1.0"

MINIMUM_SUPPORTED_VERSION = "2.5.0"
SECURE_TORCH_VERSION = "2.6.0"

if Version(torch.__version__) < Version(MINIMUM_SUPPORTED_VERSION):
warnings.warn(
f"TICO officially supports torch>={MINIMUM_SUPPORTED_VERSION}. "
f"You are using a lower version of torch ({torch.__version__}). "
f"We highly recommend to upgrade torch>={MINIMUM_SUPPORTED_VERSION} to avoid unexpected behaviors."
)

if Version(torch.__version__) < Version("2.5.0"):
if Version(torch.__version__) < Version(SECURE_TORCH_VERSION):
warnings.warn(
f"TICO officially supports torch>=2.5. You are using a lower version of torch ({torch.__version__}). We highly recommend to upgrade torch >= 2.5 to avoid unexpected behaviors."
f"Detected PyTorch version {torch.__version__}, which may include known security vulnerabilities. "
f"We recommend upgrading to {SECURE_TORCH_VERSION} or later for better security.\n"
"Upgrade command: pip install --upgrade torch\n"
"For more details, see: https://pytorch.org/security"
)