-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple backends #207
Labels
Comments
Related suggestion in #159. Agree we should be able to make |
3 tasks
6 tasks
I'm going to close this as resolved. If we want to add more backends in the future or make |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This issue tracks changes needed to fully support multiple backends in an interchangeable/generic way. The initial release of Funsor implements most funsors using PyTorch (funsor.torch implements
Tensor
, but all of funsor.gaussian, .joint, .distributions use PyTorch internally.Approach 1
One possibility is to replicate backend-specific logic in a consistent way, e.g. with module structure
Approach 2
A second possibility (suggested by @eb8680 below and in #159) is to
Tensor
intoTorchTensor
andNumpyTensor
, thenGaussian
andContraction
etc. to useTensor
s rather than torch.Tensors internally.This approach would still require duplicating distributions.
Potential backends
pyro.distributions
numpyro.distributions
tfp.distributions
tf_numpy
Other tasks
funsor.testing
andfunsor.domains
funsor[torch]
,funsor[numpy]
etc.The text was updated successfully, but these errors were encountered: