Skip to content

Commit 2f902a5

Browse files
committed
Do not allow logp_dlogp_function to receive RVs
1 parent 5fcc3e5 commit 2f902a5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pymc3/model.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -714,14 +714,11 @@ def logp_dlogp_function(self, grad_vars=None, tempered=False, **kwargs):
714714
`alpha` can be changed using `ValueGradFunction.set_weights([alpha])`.
715715
"""
716716
if grad_vars is None:
717-
grad_vars = [v.tag.value_var for v in typefilter(self.free_RVs, continuous_types)]
717+
grad_vars = [self.rvs_to_values[v] for v in typefilter(self.free_RVs, continuous_types)]
718718
else:
719719
for i, var in enumerate(grad_vars):
720720
if var.dtype not in continuous_types:
721721
raise ValueError(f"Can only compute the gradient of continuous types: {var}")
722-
# We allow one to pass the random variable terms as arguments
723-
if hasattr(var.tag, "value_var"):
724-
grad_vars[i] = var.tag.value_var
725722

726723
if tempered:
727724
with self:

0 commit comments

Comments
 (0)