Skip to content

Commit 1424d0e

Browse files
Import pt.optimize.minimize inside relevant function
1 parent 1d75f75 commit 1424d0e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pymc_extras/inference/laplace_approx/laplace.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
from pymc.util import get_default_varnames
3636
from pytensor.graph import vectorize_graph
3737
from pytensor.tensor import TensorVariable
38-
from pytensor.tensor.optimize import minimize
3938
from pytensor.tensor.type import Variable
4039

4140
from pymc_extras.inference.laplace_approx.find_map import (
@@ -109,6 +108,8 @@ def get_conditional_gaussian_approximation(
109108
f: Callable
110109
A function which accepts a value of x and args and returns [x0, log(p(x | y, params))], where x0 is the mode. x is currently both the point at which to evaluate logp and the initial guess for the minimizer.
111110
"""
111+
from pytensor.tensor.optimize import minimize
112+
112113
model = pm.modelcontext(model)
113114

114115
if args is None:

0 commit comments

Comments
 (0)