`stack`ing and `sum`ing a list of random variables ruins sampling?

slopes is a list of linear terms like b * var, where b is the slope that I want to determine and var is one of the input variables (columns in the DataFrame). I want to be able to define an arbitrary list of variables to include in these linear terms, so I’m collecting them all in the list slopes.

Since each of these linear terms is a 1D tensor (length equalling the length of my input DataFrame), I want to stack them 'side-by-side` and sum across the linear terms, to again get a 1D tensor with length equalling that of my input DataFrame.

Is there a simpler way to do that?