提交 7bd759b3 authored 作者: Frederic's avatar Frederic

Small code clean up following code review.

上级 9f1ea241
...@@ -31,11 +31,10 @@ def test(shape=(3, 4, 5)): ...@@ -31,11 +31,10 @@ def test(shape=(3, 4, 5)):
B = cudandarray_to_garray(B_cnd) B = cudandarray_to_garray(B_cnd)
assert A_cnd.shape == A.shape assert A_cnd.shape == A.shape
from numpy import array from numpy import array
B2 = array(B_cnd)
u = (A + 1).asarray() u = (A + 1).asarray()
v = B.asarray() v = B.asarray()
w = B2 w = array(B_cnd)
assert (u == v).all() assert (u == v).all()
assert (u == w).all() assert (u == w).all()
...@@ -57,7 +56,6 @@ def test2(shape=(3, 4, 5)): ...@@ -57,7 +56,6 @@ def test2(shape=(3, 4, 5)):
# assert A_cnd._strides == A_gar.strides, garray don't have strides # assert A_cnd._strides == A_gar.strides, garray don't have strides
B = garray_to_cudandarray(A_gar) B = garray_to_cudandarray(A_gar)
B2 = numpy.array(B)
assert A_cnd.shape == B.shape assert A_cnd.shape == B.shape
# assert A_cnd.dtype == B.dtype # dtype always float32 # assert A_cnd.dtype == B.dtype # dtype always float32
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论