Debug mode in PyTensor

Try model.debug() and let us know if it would have helped you figure out the problem