Cdist for a large number of pairs

Hi,

This is a very generic question.. i need to calculate the pairwise distance matrix for a large vector (± 150000), which upfront is -of course- complaining about the ram even to preallocate it, an probably the calculation time will be high too.

Is there a native way in pytorch to calculate it, like, “by batch”, or similar? (ignoring for now the fact that the variable holding the resulting matrix will also be too big)

Thanks in advance!