提交 d0804f29 编写于 作者: HansBug's avatar HansBug 😆

dev(hansbug): ignore one bug on torch

上级 c67681c5
......@@ -3,7 +3,7 @@ import unittest
import numpy as np
import pytest
import torch
from hbutils.testing import OS
from hbutils.testing import OS, vpython
import treetensor.numpy as tnp
import treetensor.torch as ttorch
......@@ -246,6 +246,11 @@ class TestNumpyArray:
}
})
# Here is a bug in torch on Windows and python3.10 environment
# RuntimeError: Numpy is not available
# The only solution I found is to downgrade python to 3.9 ==,
# so this is currently unsolvable.
@unittest.skipIf(OS.windows and vpython >= '3.10', 'Bug in torch')
def test_tensor(self):
assert ttorch.isclose(self._DEMO_1.tensor().double(), ttorch.Tensor({
'a': ttorch.Tensor([[1, 2, 3], [4, 5, 6]]),
......
import unittest
import numpy as np
import torch
from hbutils.testing import vpython, OS
from treevalue import typetrans, TreeValue, func_treelize
import treetensor.numpy as tnp
......@@ -47,6 +50,11 @@ class TestTorchTensorClass:
def test_numel(self):
assert self._DEMO_1.numel() == 18
# Here is a bug in torch on Windows and python3.10 environment
# RuntimeError: Numpy is not available
# The only solution I found is to downgrade python to 3.9 ==,
# so this is currently unsolvable.
@unittest.skipIf(OS.windows and vpython >= '3.10', 'Bug in torch')
@choose_mark()
def test_numpy(self):
assert tnp.all(self._DEMO_1.numpy() == tnp.ndarray({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册