From 50697bef2bba971a0be889e19444bb9bbb9f0daf Mon Sep 17 00:00:00 2001 From: Ricardo Vieira Date: Wed, 22 May 2024 18:13:19 +0200 Subject: [PATCH] Use add instead of sum in logp to avoid casting everything explicitly to the same dtype --- pymc/model/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymc/model/core.py b/pymc/model/core.py index 0cf8bd26cf6..5dc7f357196 100644 --- a/pymc/model/core.py +++ b/pymc/model/core.py @@ -748,7 +748,7 @@ def logp( if not sum: return logp_factors - logp_scalar = pt.sum([pt.sum(factor) for factor in logp_factors]) + logp_scalar = pt.add(*[pt.sum(factor) for factor in logp_factors]) logp_scalar_name = "__logp" if jacobian else "__logp_nojac" if self.name: logp_scalar_name = f"{logp_scalar_name}_{self.name}"