pyro-ppl/pyro

Feature request: Prohibit passing negative numbers to plate sizes

Open

#3,407 opened on Oct 24, 2024

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Python (981 forks)batch import
help wantedusability

Repository metrics

Stars
 (8,211 stars)
PR merge metrics
 (Avg merge 10d 19h) (1 merged PR in 30d)

Description

Issue Description

Plate primitives scale log-likelihood terms by size/batch_size. But plates allow negative numbers without a warning or assert. Something like assert size > 0 above https://github.com/pyro-ppl/pyro/blob/dev/pyro/primitives.py#L424 might be worth adding.

Contributor guide