Yes, see https://github.com/huawei-noah/AdderNet/issues/6#issuecomment-613362421 9
Do you have any idea what _temp = torch.cdist(_temp1, _temp2, p).squeeze().transpose(0, 1) actually does ?
Same for _temp1 and _temp2
_temp1 = torch.unsqueeze(X, 2).expand(X.shape[0], X.shape[1], W.shape[0]).permute(1, 0, 2)

_temp2 = torch.unsqueeze(W.transpose(0, 1), 1)