def dot_sim(im, s):
    """
    Cosine similarity between all the image and sentence pairs
    """
    return im.mm(s.t())
Cosine similarity between all the image and sentence pairs
towhee/models/mcprop/loss.py