def _inv_dist(self, X, X2=None):
dist = self._scaled_dist(X, X2).copy()<EOL>return <NUM_LIT:1.>/np.where(dist != <NUM_LIT:0.>, dist, np.inf)<EOL>
Compute the elementwise inverse of the distance matrix, expecpt on the
diagonal, where we return zero (the distance on the diagonal is zero).
This term appears in derviatives.