Skip to content

Commit 5b0a796

Browse files
committed
Revert "Evaluate the rv.shape directly"
This reverts commit 0ca9f68.
1 parent 0ca9f68 commit 5b0a796

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pymc_experimental/model/transforms/autoreparam.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,12 @@ def vip_reparam_node(
176176
) -> Tuple[ModelDeterministic, ModelNamed]:
177177
if not isinstance(node.op, RandomVariable | SymbolicRandomVariable):
178178
raise TypeError("Op should be RandomVariable type")
179-
rv = node.default_output()
180-
rv_shape = rv.shape.eval(mode="FAST_COMPILE")
179+
_, size, *_ = node.inputs
180+
eval_size = size.eval(mode="FAST_COMPILE")
181+
if eval_size is not None:
182+
rv_shape = tuple(eval_size)
183+
else:
184+
rv_shape = ()
181185
lam_name = f"{name}::lam_logit__"
182186
_log.debug(f"Creating {lam_name} with shape of {rv_shape}")
183187
logit_lam_ = pytensor.shared(

0 commit comments

Comments
 (0)