Skip to content

Commit b9f225b

Browse files
ricardoV94michaelosthege
authored andcommitted
Do not allow logp_dlogp_function to receive RVs
1 parent 46209f6 commit b9f225b

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
@@ -702,14 +702,11 @@ def logp_dlogp_function(self, grad_vars=None, tempered=False, **kwargs):
702702
`alpha` can be changed using `ValueGradFunction.set_weights([alpha])`.
703703
"""
704704
if grad_vars is None:
705-
grad_vars = [v.tag.value_var for v in typefilter(self.free_RVs, continuous_types)]
705+
grad_vars = [self.rvs_to_values[v] for v in typefilter(self.free_RVs, continuous_types)]
706706
else:
707707
for i, var in enumerate(grad_vars):
708708
if var.dtype not in continuous_types:
709709
raise ValueError(f"Can only compute the gradient of continuous types: {var}")
710-
# We allow one to pass the random variable terms as arguments
711-
if hasattr(var.tag, "value_var"):
712-
grad_vars[i] = var.tag.value_var
713710

714711
if tempered:
715712
with self:

0 commit comments

Comments
 (0)