This answer comes from Theano-users google group.
You define your x
variable as:
x=T.vector(dtype=theano.config.floatX)
This is it is a vector(i.e. it only have 1 dimensions).
x_inp = np.matrix('2;1',dtype=dt)
create a matrix, not a vector.
Theano graph are strongly typed, you must defined the good number of dimensions. Just use:
x_inp = np.asarray([2,1])
I actually ended up defining x
and b
as matrices.