I have a distribution defined as follows:
dprob_vector = pm.Deterministic('devp', deviations_by_input[input_id])
Elpy (emacs interface to python) runs pylint automatically on my code and flags the expression above as incorrect because it thinks
deviations_by_input is not subscriptable. Here’s how
deviations_by_input is defined:
deviations_by_input = pm.Beta("p(deviation)", alpha=1.0, beta=15.0, shape=num_inputs)
TBQH, I’m not sure how to make it obvious statically that a distribution (or any tensor?) is or is not subscriptable, since I don’t think there’s anything in the type system that distinguishes between scalars, vectors, and arrays.
Maybe the best I can do is to muffle this warning.