How to quickly compare each word vector in two sentences

My problem is that, if I got two sentence, the sentence1 have 2words, and sentence2 have 3 words, I want to align them in a less common way, use a compare function, and get 2x3 tensors like comp(a1, b1), comp(a1, b2), comp(a1, b3), comp(a2, b1), comp(a2, b2), comp(a2, b3), Is there any way to do it?

Expect to be resolved!