Looking at the function torusmodel itself it doesnt look too difficult to rewrite it into theano - have you try import theano.tensor as tt and just replace np.* with tt.*?
Looking at the function torusmodel itself it doesnt look too difficult to rewrite it into theano - have you try import theano.tensor as tt and just replace np.* with tt.*?