After https://github.com/pyro-ppl/funsor/pull/491, we are no longer able to stack Numbers. This PR relaxes this restriction because numpy, jax backends can perform stack over Python scalars
import funsor; funsor.set_backend("jax")
from funsor import ops, Number
ops.stack((Number(2.), Number(3)))
Fixes https://github.com/pyro-ppl/numpyro/issues/964
After https://github.com/pyro-ppl/funsor/pull/491, we are no longer able to stack Numbers. This PR relaxes this restriction because
numpy
,jax
backends can perform stack over Python scalars