LDA implementation with pymc3

It’s throwing an error because in t.log(theta) + t.log(phi.T), theta and phi.T has a different shape. You need to broadcast them both to the same shape first. In the example, there is an indexing to do that, and similarly you need to write the function to take observed as input also (for indexing)