First, I suggest you use the latest PyMC (not the quite old PyMC3). It uses pytensor instead of theano, which is still actively maintained by the PyMC developers.
Second, I suggest you print variable.eval().shape in a couple of places to see if the shapes you are getting are what you expect. Theano/PyTensor uses the same rules as Numpy when it comes to shape handling and broadcasting.