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

Raise errors due to dimension mismatch issues in distributions #303

Closed
neerajprad opened this issue Oct 21, 2017 · 1 comment
Closed

Raise errors due to dimension mismatch issues in distributions #303

neerajprad opened this issue Oct 21, 2017 · 1 comment
Labels
Milestone

Comments

@neerajprad
Copy link
Member

Most distributions do not explicitly check for correct dimensionality / broadcastable shapes when running their various methods. This is fine except that the client is forced to figure out what went wrong due to a some hard to comprehend error message. One simple thing to address in batch pdf would be this line, which is useful for a limited version of broadcasting but assumes that the data dimensions will always be greater than or equal to the parameter dimensions. Let us throw an error if that is not the case.

        if x.size != a.size():
            a = a.expand_as(x)
            b = b.expand_as(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants