Description
Description
In PyMC we have a SymbolicRandomVariable that allows defining an OpFromGraph that looks almost like a RandomVariable but is just built symbolically. This avoids having to define too many Ops (and backend dispatches). We should try to port it to PyTensor and make sure that everything than in PyTensor works with pure RandomVariable also works with the Symbolic counterparts.
From the top of the mind we have to make RandomStreams and RV rewrites compatible.
This is the class (it contains things that don't make sense in PyTensor, like the MeasurableOp):
https://github.com/pymc-devs/pymc/blob/ce5f2a27170a9f422f974fdf9fc415dfe53c35cb/pymc/distributions/distribution.py#L211-L399
Here is an example of how a Symbolic RV is then defined:
https://github.com/pymc-devs/pymc/blob/ce5f2a27170a9f422f974fdf9fc415dfe53c35cb/pymc/distributions/continuous.py#L1217-L1238