pyro-ppl / funsor

Functional tensors for probabilistic programming
https://funsor.pyro.ai
Apache License 2.0
236 stars 20 forks source link

Fix Independent() distribution conversion #508

Closed eb8680 closed 3 years ago

eb8680 commented 3 years ago

Unblocks https://github.com/pyro-ppl/pyro/pull/2786

This PR fixes conversion of some Independent() distributions to/from Funsors. In #491 we changed funsor.tensor.stack from a funsor.Function to an Op, breaking some pattern-matching logic in funsor.to_funsor for distributions (see e.g. eager_beta). This PR fixes that regression and reinstates the failing test cases in test_distribution_generic.py that were removed in #491.