In the Theano deep learning tutorial, y is a shared variable that is casted:
y = theano.shared(numpy.asarray(data, dtype=theano.config.floatX))
y = theano.tensor.cast(y, 'int32')
I later want to set a new value for y.
For GPU this works:
y.owner.inputs[0].owner.inputs[0].set_value(np.asarray(data2, dtype=theano.config.floatX))
For CPU this works:
y.owner.inputs[0].set_value(np.asarray(data2, dtype=theano.config.floatX))
Why does this require a different syntax between GPU and CPU? I would like my code to work for both cases, am I doing it wrong?