bayespy.utils.misc.sum_to_shape

bayespy.utils.misc.sum_to_shape(X, s)[source]

Sum axes of the array such that the resulting shape is as given.

Thus, the shape of the result will be s or an error is raised.