This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from torch import nn | |
import torch.nn.functional as F | |
from collections import OrderedDict | |
import math | |
def pdist(v): | |
dist = torch.norm(v[:, None] - v, dim=2, p=2) | |
return dist |