-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
The shape of the RandomVariable
s is hard to reason about
#1252
Comments
We can output better static shape info beyond broadcastable/not but otherwise I don't se a problem. You should be able to use Also you might want to use |
Turning this into a bug after an offline discussion with @brandonwillard, |
More specifically, it looks like |
Indeed, if I insert a breakpoint right before Line 1366 in 739bd49
folded_shape contains the correct type information (constant shapes for the cases size=(0,) and size=(2,) in the original post).
|
Yeah, I have a fix in #1253, but I should split that off from some of the other experimental stuff in that PR. |
The
RandomVariable
s intialized with different values forsize
have a concrete shape when thesize
is broadcastable, and symbolic otherwise:This is problematic for some downstream applications. In
AeHMC
we create a scalar/vectorinverse_mass_matrix
parameter based on the number of dimensions of the variable, which thus does not have a definite shape. Whena_rv.shape
is aTensorConstant
the shape checks performed inScan
will raise an error.I would expect all of the above shapes to be
TensorConstant
s, or at the very least to be all symbolic. The shapes are determined when computing the output type withTensorType(dtype=dtype, shape=bcast)
.I have marked this as a question since I might also be initializing the
inverse_mass_matrix
incorrectly (asat.scalar
orat.vector
without specifying the shape).The text was updated successfully, but these errors were encountered: