So when I try printing the various shapes, I get that the shape of a[2] is [] and the shape of b[1:5] is [4]. For reference, the shape of a is [4] and the shape of b is [7]. It looks like this is just returning the value of the shape parameter in the respective pm.Normal call.
Your suggestion to specify the axis resulted in the error “TypeError: Join() can only join tensors with the same number of dimensions.” for axis = 0, and “IndexError: axis 1 is out of bounds [-1, 1)” for axis = 1.
I tried one more thing. I guessed that this might be happening because a[2] is a scalar and b[1:5] is a vector, so I attempted pm.math.stack( [ a[2:4], b[1:5] ] , axis = 0). This yielded the error “ValueError: all the input array dimensions except for the concatenation axis must match exactly”.