eb8680

Results 70 comments of eb8680

This makes sense to me. If we do this we might also want to weaken some assertions that require exact equality of `Bint` dtypes, e.g. in `Tensor.eager_subs`, or allow `to_funsor`...

Two places in the tests where this is most prominent: `test_distribution_generic.py` and `test_sum_product.py`.

> Conversion of TransformedDistributions to and from funsors on the JAX backend (can copy #365) Note this will be a bit trickier than expected because in NumPyro `Transform.inv` is just...

> is this already completed? I don't have a backward-sampling example yet, I guess I could add that to the seal example. Let's leave this open for now.

This is not (yet) possible with the current implementation of `make_funsor`, but we'll need something like this if we want to rewrite more of `funsor.terms` with `make_funsor`. A minimal solution...

> can you confirm Yep, this should work as expected.

The CI failures are `RecursionError`s in `examples/hmm.py`. After some investigation it seems like there's an odd interaction happening between `substitute` and `funsor.optimize.apply_optimizer` that's causing the stack of interpreters to blow...

> there's an odd interaction happening between substitute and funsor.optimize.apply_optimizer that's causing the stack of interpreters to blow up Update: I believe I have fixed this by forcing alpha-renaming substitution...

[This recent paper](https://arxiv.org/abs/2105.02856) seems quite relevant, although it solves a slightly different problem.