tfm.uplift.utils.expand_to_match_rank

Expands tensor a to match the rank of tensor b.

a a tf.Tensor of shape (D0, D1, ..., Dn).
b a tf.Tensor of shape (D0, D1, ..., Dn, Dn+1, ... Dn+m).

A tf.Tensor of shape (D0, D1, ..., DN, 1, ..., 1) if b has a higher rank than a, otherwise a tf.Tensor of shape (D0, D1, ..., Dn)