def test(shape=(3, 4, 5)):
    gpu = theano.sandbox.cuda.basic_ops.gpu_from_host
    U = gpu(theano.tensor.ftensor3('U'))
    ii = theano.function([U], gpu(U + 1))

    A = gnumpy.rand(*shape)
    A_cnd = garray_to_cudandarray(A)
    assert A_cnd.shape == A.shape
    # dtype always float32
    # garray don't have strides
    B_cnd = ii(A_cnd)
    B = cudandarray_to_garray(B_cnd)
    assert A_cnd.shape == A.shape
    from numpy import array

    u = (A + 1).asarray()
    v = B.asarray()
    w = array(B_cnd)
    assert (u == v).all()
    assert (u == w).all()
Returns the position of the first differing character in the strings
dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/misc/tests/test_gnumpy_utils.py/test--crossover with--dataset/ETHPy150Open tallstreet/Whoosh-AppEngine/src/whoosh/util.py/first_diff