hacking to use logpy on theano graphs