Skip to content

Commit a4c7e46

Browse files
committed
优化对torch版本的依赖声明为>=1.12.1且<2.0
否则,现在的写法是要求用户的pytorch版本严格等于1.12.1,即使用户已经安装了更新的版本也是不行的。我认为应当允许用户使用任何Pytorch 1.X(只要大于某个特定版本,因为我们的程序可能会使用某些较新的Pytorch特性)。 根据语义化版本规则,相同的大版本号一般意味着没有API Breaking Changes,因此这样做应当不会产生问题,同时也给了用户更大的自由。 PS:版本声明字符串的语法参考https://python-poetry.org/docs/dependency-specification/#multiple-requirements
1 parent 3b5eea8 commit a4c7e46

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/source/start/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Installation
77
- Proof: Xinwei Zhang
88

99
- Python >= 3.8
10-
- Pytorch >=1.11
10+
- Pytorch >= 1.12
1111

1212
Current, the stable version of **DHG** is 0.9.2. You can install it with ``pip`` as follows:
1313

docs/source/zh/start/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- 校对: `丰一帆 <https://fengyifan.site/>`_ 、张欣炜
99

1010
- Python >= 3.8
11-
- Pytorch >=1.11
11+
- Pytorch >= 1.12
1212

1313

1414
目前, **DHG** 的最新稳定版本 **0.9.2** 已经发布,可以使用 ``pip`` 指令直接安装:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ classifiers = [
3232

3333
[tool.poetry.dependencies]
3434
python = "^3.8"
35-
torch = "1.12.1"
35+
torch = ">= 1.12.1, < 2.0"
3636
scipy = "^1.8"
3737
optuna = "*"
3838
numpy = "*"

0 commit comments

Comments
 (0)