What advantage? AFAIK pytorch does GPU binary search with ops like sort, topk, unique, median, that are not helpful for your task. And you say that brute force is too slow.
Well, unique() can tell you overlap size: (num_unique(a)+num_unique(b)) -  num_unique(cat(a,b)). Required sortings may still be too heavy though.