Skip to content

Commit 2a324bc

Browse files
ricardoV94twiecki
authored andcommitted
Bump Pytensor dependency
1 parent 5d68bf3 commit 2a324bc

13 files changed

+69
-69
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.10.1
17+
- pytensor>=2.11.0,<2.12
1818
- python-graphviz
1919
- networkx
2020
- scipy>=1.4.1

conda-envs/environment-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212
- numpy>=1.15.0
1313
- pandas>=0.24.0
1414
- pip
15-
- pytensor=2.9.1
15+
- pytensor>=2.11.0,<2.12
1616
- python-graphviz
1717
- scipy>=1.4.1
1818
- typing-extensions>=3.7.4

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.10.1
20+
- pytensor>=2.11.0,<2.12
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.10.1
17+
- pytensor>=2.11.0,<2.12
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.10.1
20+
- pytensor>=2.11.0,<2.12
2121
- python-graphviz
2222
- networkx
2323
- scipy>=1.4.1

pymc/distributions/continuous.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def get_tau_sigma(tau=None, sigma=None):
235235
else:
236236
if isinstance(sigma, Variable):
237237
# Keep tau negative, if sigma was negative, so that it will fail when used
238-
tau = (sigma**-2.0) * pt.sgn(sigma)
238+
tau = (sigma**-2.0) * pt.sign(sigma)
239239
else:
240240
sigma_ = np.asarray(sigma)
241241
if np.any(sigma_ <= 0):
@@ -248,7 +248,7 @@ def get_tau_sigma(tau=None, sigma=None):
248248
else:
249249
if isinstance(tau, Variable):
250250
# Keep sigma negative, if tau was negative, so that it will fail when used
251-
sigma = pt.abs(tau) ** (-0.5) * pt.sgn(tau)
251+
sigma = pt.abs(tau) ** (-0.5) * pt.sign(tau)
252252
else:
253253
tau_ = np.asarray(tau)
254254
if np.any(tau_ <= 0):

pymc/distributions/dist_math.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def impl(self, x):
370370
def grad(self, inp, grads):
371371
(x,) = inp
372372
(gz,) = grads
373-
return (gz * (i1e_scalar(x) - pytensor.scalar.sgn(x) * i0e_scalar(x)),)
373+
return (gz * (i1e_scalar(x) - pytensor.scalar.sign(x) * i0e_scalar(x)),)
374374

375375

376376
i0e_scalar = I0e(upgrade_to_float_no_complex, name="i0e")

pymc/distributions/multivariate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,8 +2059,8 @@ def make_node(self, rng, size, dtype, mu, W, alpha, tau):
20592059
sparse = isinstance(W, pytensor.sparse.SparseVariable)
20602060
msg = "W must be a symmetric adjacency matrix."
20612061
if sparse:
2062-
abs_diff = pytensor.sparse.basic.mul(pytensor.sparse.basic.sgn(W - W.T), W - W.T)
2063-
W = Assert(msg)(W, pt.isclose(pytensor.sparse.basic.sp_sum(abs_diff), 0))
2062+
abs_diff = pytensor.sparse.basic.mul(pytensor.sparse.sign(W - W.T), W - W.T)
2063+
W = Assert(msg)(W, pt.isclose(pytensor.sparse.sp_sum(abs_diff), 0))
20642064
else:
20652065
W = Assert(msg)(W, pt.allclose(W, W.T))
20662066

pymc/logprob/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ def find_measurable_transforms(fgraph: FunctionGraph, node: Node) -> Optional[Li
608608
return None
609609
try:
610610
(power,) = other_inputs
611-
power = pt.get_scalar_constant_value(power).item()
611+
power = pt.get_underlying_scalar_constant_value(power).item()
612612
# Power needs to be a constant
613613
except NotScalarConstantError:
614614
return None

pymc/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ def make_obs_var(
14431443
# values, and another for the non-missing values.
14441444

14451445
antimask_idx = (~mask).nonzero()
1446-
nonmissing_data = pt.as_tensor_variable(data[antimask_idx])
1446+
nonmissing_data = pt.as_tensor_variable(data[antimask_idx].data)
14471447
unmasked_rv_var = rv_var[antimask_idx]
14481448
unmasked_rv_var = unmasked_rv_var.owner.clone().default_output()
14491449

0 commit comments

Comments
 (0)