Hi. Is there a way to group various subsets of random variables into a single vector to use in vector operations? For example, say my model looks something like:

a = pm.Normal(…, shape=4)

b = pm.Normal(…, shape=7)

and I would like to compute something like the dot product of [ a[2], b[1], b[2], b[3], b[4] ] with a 5-element vector x = [x1, x2, x3, x4, x5]. How would I go about doing that?

I have tried doing approximately these two solutions:

vec = pm.math.concatenate( (a[2], b[1:5] )

vec = pm.math.stack( (a[2], b[1:5] )

but I get errors about joining Tensors of different dimensions.

I think I am missing something very simple here, anybody know what it is?

Thanks.