bayespy.utils.misc.sum_to_dim

bayespy.utils.misc.sum_to_dim(A, dim)[source]

Sum leading axes of A such that A has dim dimensions.