Skip to content

Commit

Permalink
fix: jensen-shannon python f64 test fail
Browse files Browse the repository at this point in the history
  • Loading branch information
rhdong committed Jul 24, 2024
1 parent 8a7e922 commit b47e8b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cpp/src/distance/detail/distance_ops/jensen_shannon.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ struct jensen_shannon_distance_op {

DI void core(AccT& acc, DataT& x, DataT& y) const
{
auto x_ = raft::to_float(x);
auto y_ = raft::to_float(y);
AccT x_ = raft::to_float(x);
AccT y_ = raft::to_float(y);
const AccT m = 0.5f * (x_ + y_);
const bool m_zero = (m == 0);
const auto logM = (!m_zero) * raft::log(m + m_zero);
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/distance/detail/distance_ops/kl_divergence.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ struct kl_divergence_op {
{
// TODO: make sure that these branches get hoisted out of main loop.. Could
// be quite expensive otherwise.
auto x_ = raft::to_float(x);
auto y_ = raft::to_float(y);
AccT x_ = raft::to_float(x);
AccT y_ = raft::to_float(y);
if (x_equal_y) {
if (is_row_major) {
const bool x_zero = (x_ == 0);
Expand Down

0 comments on commit b47e8b0

Please sign in to comment.