Expected an array-like object, but found a Variable

theano.function is meant for compiling a tensor expression into a callable, so if you have a series of tensor operation outputs = theano.tensor.XX(*inputs), the computation is not actually done as we only build out the rule how you might do the computation when you see the data. theano.function([*inputs], outputs) returns a function like object you can call like a NumPy function. More information is in the doc: function - defines aesara.function — Aesara 2.3.2+17.g79961a625.dirty documentation

More specific, during modeling with PyMC you rarely need to use theano.function, as in the model only tensor are passing around.