Find Jaccard similarity between 2 vectors of different lengths

I have two tensors (1D array of integers) of unequal lengths and I want to calculate the jaccard similarity between them in PyTorch.

My current implementation is valid for same-length arrays only

def js_pt(list1, list2):
    intersection = (list1 * list2).abs().sum(dim=-1)
    sum_ = torch.sum(list1.abs() + list2.abs(), dim=-1)
    jac = (intersection) / (sum_ - intersection)
    return (1 - jac)

How can I modify it for tensors with unequal lengths?