Skip to content

Prohibit negative plate sizes - #3477

Open
webzuweb wants to merge 1 commit into
pyro-ppl:devfrom
webzuweb:fix/plate-negative-size
Open

webzuweb wants to merge 1 commit into
pyro-ppl:devfrom
webzuweb:fix/plate-negative-size

Conversation

@webzuweb

@webzuweb webzuweb commented Sep 9, 2026

Copy link
Copy Markdown

Fixes #3407.

pyro.plate silently accepted negative size and subsample_size values, which can produce empty or degenerate subsamples and give misleading likelihood scaling.

Add validation in SubsampleMessenger._subsample that raises ValueError for negative size and subsample_size.

Added tests test_plate_rejects_negative_size and test_plate_rejects_negative_subsample_size.

pyro.plate accepted negative size and subsample_size values
without warning, silently producing empty or degenerate
subsamples. Raise ValueError for negative values.

Fixes pyro-ppl#3407.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Prohibit passing negative numbers to plate sizes

1 participant