def test_getshape():
shapelist = [
((1, 2, 3), (1, 2, 3)),
((1,), (1,)),
((1, 2, 3), (3, 2, 1)),
((1, 2, 3), (6,)),
((1, 2, 3, 2), (6, 2)),
((2, 3, 2), (6, 2))
]
def subtest(shape):
a = theano._asarray(numpy.random.rand(*shape_1), dtype='float32')
b = cuda_ndarray.CudaNdarray(a)
assert b.shape == a.shape
for shape_1, shape_2 in shapelist:
subtest(shape_1)
subtest(shape_2)
评论列表
文章目录