Skip to content
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

Allow to use Delta on numpy arrays without moving them to jax devices #1777

Merged
merged 3 commits into from
Apr 12, 2024

Conversation

fehiepsi
Copy link
Member

Currently, the broadcast_to operator in sample converts numpy arrays into jax arrays. Keeping the original type would be nice in case we only want Delta to hold some value in the trace.

@OlaRonning
Copy link
Member

@fehiepsi I checked a few small examples, and they work fine, but I don't understand the use case.

@fehiepsi
Copy link
Member Author

Hi Ola, in one of my applications, I want to store a dictionary in the trace. Having this functionality would be convenient. I can create a custom Delta distribution for that, but using the default one would be nicer.

Copy link
Member

@OlaRonning OlaRonning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation. LGTM.

@OlaRonning OlaRonning merged commit e84f004 into pyro-ppl:master Apr 12, 2024
4 checks passed
OlaRonning pushed a commit to aleatory-science/numpyro that referenced this pull request May 6, 2024
…pyro-ppl#1777)

* allow to use Delta on numpy arrays without moving them to devices

* fix lint

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants