def METHOD_NAME(embs_a: Tensor, embs_b: Tensor) -> Tensor:
    """
    Computes the cosine similarity cos_sim(a[i], b[j]) for all i and j.
    Using torch.nn.functional.cosine_similarity
    :return: Matrix with res[i][j]  = cos_sim(a[i], b[j])
    """
    if not isinstance(embs_a, torch.Tensor):
        embs_a = torch.tensor(np.array(embs_a))
    if not isinstance(embs_b, torch.Tensor):
        embs_b = torch.tensor(np.array(embs_b))
    if len(embs_a.shape) == 1:
        embs_a = embs_a.unsqueeze(0)
    if len(embs_b.shape) == 1:
        embs_b = embs_b.unsqueeze(0)
    A = F.cosine_similarity(embs_a.unsqueeze(1), embs_b.unsqueeze(0), dim=2)
    return A