We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a9c294 commit 4c38fadCopy full SHA for 4c38fad
1 file changed
backend/find_pytorch.py
@@ -111,7 +111,11 @@ def get_pt_requirement(pt_version: str = "") -> dict:
111
112
return {
113
"torch": [
114
- f"torch=={Version(pt_version).base_version}"
+ # uv has different local version behaviors, i.e. `==2.3.1` cannot match `==2.3.1+cpu`
115
+ # https://github.com/astral-sh/uv/blob/main/PIP_COMPATIBILITY.md#local-version-identifiers
116
+ # luckily, .* (prefix matching) defined in PEP 440 can match any local version
117
+ # https://peps.python.org/pep-0440/#version-matching
118
+ f"torch=={Version(pt_version).base_version}.*"
119
if pt_version != ""
120
else "torch>=2a",
121
],
0 commit comments