HMMs with PyMC3: Complexity and point estimates

That post you are looking at is pretty old and the implementation is not optimal. You should instead take a look at How to marginalized Markov Chain with categorical?