Skip to content

Refactor _check_start_shape to evaluate shapes without needing to draw samples #5031

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

Closed
michaelosthege opened this issue Sep 27, 2021 · 1 comment

Comments

@michaelosthege
Copy link
Member

The current implementation catches sampling errors, but in theory we should be able to evaluate shapes without needing random sampling implementations.

Also see #5027

@michaelosthege
Copy link
Member Author

Here's something to start with:

for rvname, dims in pmodel.RV_dims.items():
    rv = pmodel[rvname]
    actual = tuple(rv.shape.eval())
    expected = tuple(
        int(pmodel.dim_lengths[dname].eval())
        for dname in dims
    )
    if actual != expected:
        raise pymc3.ShapeError(f"Something is wrong with RV '{rv}'.", actual, expected)

michaelosthege added a commit to michaelosthege/pymc that referenced this issue Oct 9, 2021
@twiecki twiecki closed this as completed in 595e164 Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant