Skip to content

Commit

Permalink
Revert "Evaluate the rv.shape directly"
Browse files Browse the repository at this point in the history
This reverts commit 0ca9f68.
  • Loading branch information
ferrine committed Jul 23, 2024
1 parent 0ca9f68 commit 5b0a796
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pymc_experimental/model/transforms/autoreparam.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,12 @@ def vip_reparam_node(
) -> Tuple[ModelDeterministic, ModelNamed]:
if not isinstance(node.op, RandomVariable | SymbolicRandomVariable):
raise TypeError("Op should be RandomVariable type")
rv = node.default_output()
rv_shape = rv.shape.eval(mode="FAST_COMPILE")
_, size, *_ = node.inputs
eval_size = size.eval(mode="FAST_COMPILE")
if eval_size is not None:
rv_shape = tuple(eval_size)
else:
rv_shape = ()
lam_name = f"{name}::lam_logit__"
_log.debug(f"Creating {lam_name} with shape of {rv_shape}")
logit_lam_ = pytensor.shared(
Expand Down

0 comments on commit 5b0a796

Please sign in to comment.