Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7c8adbf

Browse files
committed
add missing const keyword for memoryviews
1 parent a62775e commit 7c8adbf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sklearn/tree/_splitter.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ cdef class Splitter:
117117

118118
cdef int init(self,
119119
object X,
120-
DOUBLE_t[:, ::1] y,
120+
const DOUBLE_t[:, ::1] y,
121121
DOUBLE_t* sample_weight,
122122
np.ndarray X_idx_sorted=None) except -1:
123123
"""Initialize the splitter.
@@ -237,7 +237,7 @@ cdef class Splitter:
237237

238238

239239
cdef class BaseDenseSplitter(Splitter):
240-
cdef DTYPE_t[:, :] X
240+
cdef const DTYPE_t[:, :] X
241241

242242
cdef np.ndarray X_idx_sorted
243243
cdef INT32_t* X_idx_sorted_ptr
@@ -261,7 +261,7 @@ cdef class BaseDenseSplitter(Splitter):
261261

262262
cdef int init(self,
263263
object X,
264-
DOUBLE_t[:, ::1] y,
264+
const DOUBLE_t[:, ::1] y,
265265
DOUBLE_t* sample_weight,
266266
np.ndarray X_idx_sorted=None) except -1:
267267
"""Initialize the splitter
@@ -877,7 +877,7 @@ cdef class BaseSparseSplitter(Splitter):
877877

878878
cdef int init(self,
879879
object X,
880-
DOUBLE_t[:, ::1] y,
880+
const DOUBLE_t[:, ::1] y,
881881
DOUBLE_t* sample_weight,
882882
np.ndarray X_idx_sorted=None) except -1:
883883
"""Initialize the splitter

0 commit comments

Comments
 (0)