Updates
must contain a list of pairs
. See official tutorial on using shared variables.
Correct code:
import theano as th
import theano.tensor as T
import numpy as np
x = T.dscalars('x')
z = th.shared(np.zeros(2))
updates = [(z, z+x)]
f1 = th.function(inputs=[x], updates=updates)
f1(3)
print z.get_value()