BP: using the right tensor representation for marginals