File tree 3 files changed +4
-1
lines changed
3 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ echo "pylint check"
8
8
pylint tensorcircuit tests examples/* .py
9
9
echo " pytest check"
10
10
pytest -n auto --cov=tensorcircuit -vv -W ignore::DeprecationWarning
11
+ # for test on gpu machine, please set `export TF_FORCE_GPU_ALLOW_GROWTH=true` for tf
12
+ # and `export XLA_PYTHON_CLIENT_PREALLOCATE=false` for jax to avoid OOM in testing
11
13
echo " sphinx check"
12
14
cd docs && sphinx-build source build/html && sphinx-build source -D language=" zh" build/html_cn
13
15
echo " all checks passed, congratulation! 💐"
Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ def test_backend_methods_2(backend):
300
300
def test_device_cpu_only (backend ):
301
301
a = tc .backend .ones ([])
302
302
dev_str = tc .backend .device (a )
303
- assert dev_str == "cpu"
303
+ assert dev_str in [ "cpu" , "gpu:0" ]
304
304
tc .backend .device_move (a , dev_str )
305
305
306
306
Original file line number Diff line number Diff line change @@ -297,6 +297,7 @@ def test_dlpack_transformation(backend):
297
297
target_backend = b ,
298
298
enable_dlpack = True ,
299
299
)
300
+ ans = tc .interfaces .which_backend (ans ).device_move (ans , "cpu" )
300
301
np .testing .assert_allclose (ans , np .ones ([2 ]))
301
302
302
303
You can’t perform that action at this time.
0 commit comments