From 3f165efc6916ecc70419d1328a71571b903465de Mon Sep 17 00:00:00 2001 From: Ivan Yashchuk Date: Sun, 28 Feb 2021 17:02:23 +0200 Subject: [PATCH] Theano (aesara) doesn't have theano.gof anymore --- fenics_pymc3/core.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fenics_pymc3/core.py b/fenics_pymc3/core.py index 4e0de89..33344a3 100644 --- a/fenics_pymc3/core.py +++ b/fenics_pymc3/core.py @@ -1,5 +1,11 @@ import theano -from theano.gof import Op, Apply + +try: + from theano.graph.op import Op, Apply, type +except ModuleNotFoundError: + # older version of theano + from theano.gof import Op, Apply, type + import functools @@ -7,7 +13,7 @@ class FenicsVJPOp(Op): - params_type = theano.gof.type.Generic() + params_type = type.Generic() __props__ = ("ofunc", "templates", "fenics_output", "fenics_inputs", "tape") def __init__(self, ofunc, templates, fenics_output, fenics_inputs, tape):