Skip to content

Port SymbolicRandomVariable Op to PyTensor and get rid of many RVs in PyTensor #1221

Open
@ricardoV94

Description

@ricardoV94

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions