def test_nvcc_bug():
 shape = (5, 4)
 aa = theano._asarray(numpy.random.rand(*shape), dtype='float32')
 a = aa[::None, ::(-1)]
 b = cuda_ndarray.CudaNdarray(aa)[::None, ::(-1)]
 c = copy.copy(b)
 d = copy.deepcopy(b)
 assert numpy.allclose(a, numpy.asarray(b))
 assert numpy.allclose(a, numpy.asarray(c))
 assert numpy.allclose(a, numpy.asarray(d))
 b += b
 assert numpy.allclose((a + a), numpy.asarray(b))
 assert numpy.allclose((a + a), numpy.asarray(c))
 assert numpy.allclose(a, numpy.asarray(d))

def test_nvcc_bug ( ) : shape = ( 5 , 4 ) aa = theano . _asarray ( numpy . random . rand ( * shape ) , dtype = 'float32' ) a = aa [ : : None , : : ( - 1 ) ] b = cuda_ndarray . CudaNdarray ( aa ) [ : : None , : : ( - 1 ) ] c = copy . copy ( b ) d = copy . deepcopy ( b ) assert numpy . allclose ( a , numpy . asarray ( b ) ) assert numpy . allclose ( a , numpy . asarray ( c ) ) assert numpy . allclose ( a , numpy . asarray ( d ) ) b += b assert numpy . allclose ( ( a + a ) , numpy . asarray ( b ) ) assert numpy . allclose ( ( a + a ) , numpy . asarray ( c ) ) assert numpy . allclose ( a , numpy . asarray ( d ) )
the fct k_elemwise_unary_rowmajor_copy(used by cuda .