Compute IOU on 2 quadrangles

I am trying to compute IOU(intersection of union) on 2 quadrangles.
Here are two quadrangles. quadA(tensor):[1x8] and quadB(tensor)[1x8]
How to do that?