Skip to content

Commit 547cf57

Browse files
committed
Update PyTensor dependency
1 parent 2cadacb commit 547cf57

15 files changed

+23
-19
lines changed

conda-envs/environment-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
- numpy>=1.15.0
1515
- pandas>=0.24.0
1616
- pip
17-
- pytensor=2.8.10
17+
- pytensor=2.8.11
1818
- python-graphviz
1919
- networkx
2020
- scipy>=1.4.1

conda-envs/environment-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
- numpy>=1.15.0
1818
- pandas>=0.24.0
1919
- pip
20-
- pytensor=2.8.10
20+
- pytensor=2.8.11
2121
- python-graphviz
2222
- networkx
2323
- scipy>=1.4.1

conda-envs/windows-environment-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
- numpy>=1.15.0
1515
- pandas>=0.24.0
1616
- pip
17-
- pytensor=2.8.10
17+
- pytensor=2.8.11
1818
- python-graphviz
1919
- networkx
2020
- scipy>=1.4.1

conda-envs/windows-environment-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
- numpy>=1.15.0
1818
- pandas>=0.24.0
1919
- pip
20-
- pytensor=2.8.10
20+
- pytensor=2.8.11
2121
- python-graphviz
2222
- networkx
2323
- scipy>=1.4.1

pymc/distributions/distribution.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
from pytensor import tensor as at
2727
from pytensor.compile.builders import OpFromGraph
2828
from pytensor.graph import node_rewriter
29-
from pytensor.graph.basic import Node, Variable, clone_replace
29+
from pytensor.graph.basic import Node, Variable
30+
from pytensor.graph.replace import clone_replace
3031
from pytensor.graph.rewriting.basic import in2out
3132
from pytensor.graph.utils import MetaType
3233
from pytensor.tensor.basic import as_tensor_variable

pymc/distributions/timeseries.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
import pytensor
2222
import pytensor.tensor as at
2323

24-
from pytensor.graph.basic import Node, clone_replace
24+
from pytensor.graph.basic import Node
25+
from pytensor.graph.replace import clone_replace
2526
from pytensor.tensor import TensorVariable
2627
from pytensor.tensor.random.op import RandomVariable
2728

pymc/logprob/transforms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@
4242
import pytensor.tensor as at
4343

4444
from pytensor.gradient import DisconnectedType, jacobian
45-
from pytensor.graph.basic import Apply, Node, Variable, clone_replace
45+
from pytensor.graph.basic import Apply, Node, Variable
4646
from pytensor.graph.features import AlreadyThere, Feature
4747
from pytensor.graph.fg import FunctionGraph
4848
from pytensor.graph.op import Op
49+
from pytensor.graph.replace import clone_replace
4950
from pytensor.graph.rewriting.basic import GraphRewriter, in2out, node_rewriter
5051
from pytensor.scalar import Add, Exp, Log, Mul, Reciprocal
5152
from pytensor.scan.op import Scan

pymc/pytensorf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ def collect_default_updates(
10361036
assert random_var.owner.op is not None
10371037
if isinstance(random_var.owner.op, RandomVariable):
10381038
rng = random_var.owner.inputs[0]
1039-
if hasattr(rng, "default_update"):
1039+
if getattr(rng, "default_update", None) is not None:
10401040
update_map = {rng: rng.default_update}
10411041
else:
10421042
update_map = {rng: random_var.owner.outputs[0]}

pymc/sampling/jax.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222

2323
from arviz.data.base import make_attrs
2424
from pytensor.compile import SharedVariable, Supervisor, mode
25-
from pytensor.graph.basic import clone_replace, graph_inputs
25+
from pytensor.graph.basic import graph_inputs
2626
from pytensor.graph.fg import FunctionGraph
27+
from pytensor.graph.replace import clone_replace
2728
from pytensor.link.jax.dispatch import jax_funcify
2829
from pytensor.raise_op import Assert
2930
from pytensor.tensor import TensorVariable
@@ -70,7 +71,7 @@ def _replace_shared_variables(graph: List[TensorVariable]) -> List[TensorVariabl
7071

7172
shared_variables = [var for var in graph_inputs(graph) if isinstance(var, SharedVariable)]
7273

73-
if any(hasattr(var, "default_update") for var in shared_variables):
74+
if any(var.default_update is not None for var in shared_variables):
7475
raise ValueError(
7576
"Graph contains shared variables with default_update which cannot "
7677
"be safely replaced."

pymc/smc/kernels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import numpy as np
2222
import pytensor.tensor as at
2323

24-
from pytensor.graph.basic import clone_replace
24+
from pytensor.graph.replace import clone_replace
2525
from scipy.special import logsumexp
2626
from scipy.stats import multivariate_normal
2727

0 commit comments

Comments
 (0)