Skip to content

Commit 2c946fa

Browse files
committed
Keep RV name when filtering in replacements
1 parent c9832a7 commit 2c946fa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pymc/aesaraf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,9 @@ def poulate_replacements(rv, replacements):
376376
if transform is not None:
377377
# We want to replace uses of the RV by the back-transformation of its value
378378
value = transform.backward(value, *rv.owner.inputs)
379+
# The value may have a less precise type than the rv. In this case
380+
# filter_variable will add a SpecifyShape to ensure they are consistent
381+
value = rv.type.filter_variable(value, allow_convert=True)
379382
value.name = rv.name
380383

381384
replacements[rv] = value

0 commit comments

Comments
 (0)