"sgl-kernel/git@developer.sourcefind.cn:zhaoyu6/sglang.git" did not exist on "62d065ca4ab15eba9b5237258145ffb2d9b2ca49"
test_version.py 379 Bytes
Newer Older
1
from fairscale.internal import torch_version
2
3
4
5
6
7
8
9
10


def test_torch_version():
    assert torch_version("") == tuple()
    assert torch_version("bad format") == tuple()
    assert torch_version("1.9.0") == (1, 9, 0)
    assert torch_version("1.10.0a0+gitbc6fc3e") == (1, 10, 0)
    assert torch_version("1.7.0+cu102") == (1, 7, 0)
    assert torch_version("1.10.0a0+fb") == (1, 10, 0)