Way to check the shape of output matrix

I know it sounds silly, but is there any way to check the shape of the output?
(I got spoiled with python notebook style and just wondering easier way to check stan in a real time)

For example, I want to see whether operator * is producing (4,5) matrix if I am calculating matrix[4,1] * matrix[1,5]


You can use

print(rows(a), cols(a));

but in general, if you have an M x N matrix and multiply it by an N x L matrix, the result is M x L. Stan will complain if the dimensions don’t line up or you’re trying to assign to something with sizes that don’t match its declaration.