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

broadcast numerical types to jnp.array for flexible shapes #11

Closed
Qazalbash opened this issue Dec 27, 2023 · 0 comments
Closed

broadcast numerical types to jnp.array for flexible shapes #11

Qazalbash opened this issue Dec 27, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Qazalbash
Copy link
Owner

Description

rvs = Beta(alpha=1.1, beta=5.5).rvs(10) # fine
rvs = Beta(alpha=jnp.array([1.1, 1.0]), beta=jnp.array([5.5, 3.0])).rvs(10) # gives error.

error is,

ValueError: beta parameter shapes must be broadcast-compatible with shape argument, and the result of broadcasting the shapes must equal the shape argument, but got result (10, 2) for shape argument (10, 1).

Proposal

It would be great to write a generic function that broadcasts every element to an array and define it in some general folder like utils.

@Qazalbash Qazalbash added the bug Something isn't working label Dec 27, 2023
@Qazalbash Qazalbash self-assigned this Dec 27, 2023
Qazalbash added a commit that referenced this issue Dec 28, 2023
@Qazalbash Qazalbash modified the milestones: Distributions, Samplers Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant