Skip to content

Commit

Permalink
Fix clamping to "true" positives
Browse files Browse the repository at this point in the history
  • Loading branch information
cjnolet committed Oct 17, 2023
1 parent 8afb99f commit cc6aaaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/include/raft/distance/detail/distance_ops/l2_exp.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ struct l2_exp_distance_op {
DataT val = regxn[i] + regyn[j] - (DataT)2.0 * acc[i][j];
// val could be negative due to numerical instability, especially when
// calculating self distance. Clamp to 0 to avoid potential NaN in sqrt
acc[i][j] = val * (raft::abs(val) >= DataT(0.0001));
acc[i][j] = val * (val >= DataT(1e-6));
}
}
if (sqrt) {
Expand Down

0 comments on commit cc6aaaa

Please sign in to comment.