-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
The behavior of the logprob when the value variable doesn't match shape is exactly the same as the logprob of the underlying components. If it doesn't match, it will try to broadcast and fail if it cannot. Other than that we don't use size information in any of the core logprob functions.
pm.logp(pm.Normal.dist(size=(4,)), np.ones((2,)))
will be happy to return a logp with two values.One other case where this shows up is in graphs of the form
pt.ones((5,)) + pm.Normal.dist()
which we infer to have an equivalent logp as that ofpm.Normal.dist(shape=(5,))
even though the generative process contains only one true random variable, and not 5.I think we need a bigger discussion about the role of shape information in the random and logp graphs, so I wouldn't treat
IfElse
differently for now.
Originally discussed in #6529 (comment)