It’s strange, but my code of implementing the gamma_cdf:
gamma_latent = pm.Gamma('gamma_latent', alpha=α, beta=β)
def gamma_cdf(x):
return tt.exp(pm.logcdf(gamma_latent, x))
resulted in error after updating to the version 1.27.0
File ~/.local/lib/python3.11/site-packages/pymc/logprob/basic.py:311, in logcdf(rv, value, warn_rvs, **kwargs)
309 fgraph, rv_values, _ = construct_ir_fgraph({rv: value})
310 [ir_rv] = fgraph.outputs
--> 311 expr = _logcdf_helper(ir_rv, value, **kwargs)
312 cleanup_ir([expr])
313 if warn_rvs:
File ~/.local/lib/python3.11/site-packages/pymc/logprob/abstract.py:101, in _logcdf_helper(rv, value, **kwargs)
99 def _logcdf_helper(rv, value, **kwargs):
100 """Helper that calls `_logcdf` dispatcher."""
--> 101 logcdf = _logcdf(rv.owner.op, value, *rv.owner.inputs, name=rv.name, **kwargs)
103 if rv.name:
104 logcdf.name = f"{rv.name}_logcdf"
File /usr/lib/python3.11/functools.py:909, in singledispatch.<locals>.wrapper(*args, **kw)
905 if not args:
906 raise TypeError(f'{funcname} requires at least '
907 '1 positional argument')
--> 909 return dispatch(args[0].__class__)(*args, **kw)
File ~/.local/lib/python3.11/site-packages/pymc/logprob/abstract.py:96, in _logcdf(op, value, *inputs, **kwargs)
83 @singledispatch
84 def _logcdf(
85 op: Op,
(...)
88 **kwargs,
89 ):
90 """Create a graph for the logcdf of a ``RandomVariable``.
91
92 This function dispatches on the type of ``op``, which should be a subclass
93 of ``RandomVariable``. If you want to implement new logcdf graphs
94 for a ``RandomVariable``, register a new function on this dispatcher.
95 """
---> 96 raise NotImplementedError(f"LogCDF method not implemented for {op}")
NotImplementedError: LogCDF method not implemented for gamma_rv{0, (0, 0), floatX, False}
It worked fine for earlier versions like, for example, 1.26.3.
Have someone experienced something similar?