Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Pringled committed Nov 29, 2024
1 parent 342a308 commit e89d354
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vicinity/backends/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,5 @@ def _dist(self, x: npt.NDArray) -> npt.NDArray:
x_norm = (x**2).sum(1)
dists_squared = (x_norm[:, None] + self.squared_norm_vectors[None, :]) - 2 * (x @ self._vectors.T)
# Ensure non-negative distances
dists_squared = np.maximum(dists_squared, 1e-12)
dists_squared = np.clip(dists_squared, 0, None)
return np.sqrt(dists_squared)

0 comments on commit e89d354

Please sign in to comment.