def METHOD_NAME(self, x1, batch1, x2, batch2):
    att_scores = torch.mm(x1, x2.T)
    att_scores[batch1.view(-1,1) != batch2.view(1,-1)] = -float('inf')
    att_weights1 = F.softmax(att_scores, dim=1)
    att_weights2 = F.softmax(att_scores.T, dim=1)
    attentions1 = x1 - torch.mm(att_weights1, x2)
    attentions2 = x2 - torch.mm(att_weights2, x1)
    return attentions1, attentions2