def increment_odd(x):
    return T.inc_subtensor(x[1::2], 1.)

    x = T.vector()

    xv = np.zeros((4,), dtype=x.dtype)
    yv = increment_odd(x).eval({x:xv})



Hello I'm implementing this simple code to test inc_subtensor, which give 
me this error 

>
> RuntimeError: Error doing inplace add
> Apply node that caused the error: 
> GpuIncSubtensor{InplaceInc;::}(GpuFromHost<None>.0, GpuArrayConstant{1.0})
> Toposort index: 1
> Inputs types: [GpuArrayType<None>(float32, (False,)), 
> GpuArrayType<None>(float32, ())]
> Inputs shapes: [(4,), ()]
> Inputs strides: [(4,), ()]
> Inputs values: [gpuarray.array([ 0., 0., 0., 0.], dtype=float32), 
> gpuarray.array(1.0, dtype=float32)]
> Outputs clients: 
> [[HostFromGpu(gpuarray)(GpuIncSubtensor{InplaceInc;::}.0)]]


So I tested set_subtensor and it worked with me. what is wrong in this 
implementation ? 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to