Skip to content

Commit 063af42

Browse files
committed
Fix logccdf IR rewriting to match logcdf pattern
The construct_ir_fgraph returns a single FunctionGraph, not a tuple. Extract ir_valued_rv from outputs and unpack ir_rv and ir_value from inputs.
1 parent 15806c0 commit 063af42

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pymc/logprob/basic.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,10 @@ def logccdf(rv: TensorVariable, value: TensorLike, warn_rvs=True, **kwargs) -> T
357357
return _logccdf_helper(rv, value, **kwargs)
358358
except NotImplementedError:
359359
# Try to rewrite rv
360-
fgraph, _, _ = construct_ir_fgraph({rv: value})
361-
[ir_rv] = fgraph.outputs
362-
expr = _logccdf_helper(ir_rv, value, **kwargs)
360+
fgraph = construct_ir_fgraph({rv: value})
361+
[ir_valued_rv] = fgraph.outputs
362+
[ir_rv, ir_value] = ir_valued_rv.owner.inputs
363+
expr = _logccdf_helper(ir_rv, ir_value, **kwargs)
363364
[expr] = cleanup_ir([expr])
364365
if warn_rvs:
365366
_warn_rvs_in_inferred_graph([expr])

0 commit comments

Comments
 (0)