Skip to content

MAINT Adapt DistanceMetric in prevision for fused sparse-dense support #24223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

14 changes: 7 additions & 7 deletions sklearn/metrics/_dist_metrics.pxd.tp
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ cdef class DistanceMetric{{name_suffix}}:

cdef DTYPE_t dist_csr(
self,
const {{INPUT_DTYPE_t}}[:] x1_data,
const {{INPUT_DTYPE_t}}* x1_data,
const SPARSE_INDEX_TYPE_t[:] x1_indices,
const {{INPUT_DTYPE_t}}[:] x2_data,
const {{INPUT_DTYPE_t}}* x2_data,
const SPARSE_INDEX_TYPE_t[:] x2_indices,
const SPARSE_INDEX_TYPE_t x1_start,
const SPARSE_INDEX_TYPE_t x1_end,
Expand All @@ -114,9 +114,9 @@ cdef class DistanceMetric{{name_suffix}}:

cdef DTYPE_t rdist_csr(
self,
const {{INPUT_DTYPE_t}}[:] x1_data,
const {{INPUT_DTYPE_t}}* x1_data,
const SPARSE_INDEX_TYPE_t[:] x1_indices,
const {{INPUT_DTYPE_t}}[:] x2_data,
const {{INPUT_DTYPE_t}}* x2_data,
const SPARSE_INDEX_TYPE_t[:] x2_indices,
const SPARSE_INDEX_TYPE_t x1_start,
const SPARSE_INDEX_TYPE_t x1_end,
Expand All @@ -140,7 +140,7 @@ cdef class DistanceMetric{{name_suffix}}:

cdef int pdist_csr(
self,
const {{INPUT_DTYPE_t}}[:] x1_data,
const {{INPUT_DTYPE_t}}* x1_data,
const SPARSE_INDEX_TYPE_t[:] x1_indices,
const SPARSE_INDEX_TYPE_t[:] x1_indptr,
const ITYPE_t size,
Expand All @@ -149,10 +149,10 @@ cdef class DistanceMetric{{name_suffix}}:

cdef int cdist_csr(
self,
const {{INPUT_DTYPE_t}}[:] x1_data,
const {{INPUT_DTYPE_t}}* x1_data,
const SPARSE_INDEX_TYPE_t[:] x1_indices,
const SPARSE_INDEX_TYPE_t[:] x1_indptr,
const {{INPUT_DTYPE_t}}[:] x2_data,
const {{INPUT_DTYPE_t}}* x2_data,
const SPARSE_INDEX_TYPE_t[:] x2_indices,
const SPARSE_INDEX_TYPE_t[:] x2_indptr,
const ITYPE_t size,
Expand Down
Loading