theano errors when compiling function