Skip to content

Commit

Permalink
BUG Fixes cython code for ppc arch (#17201)
Browse files Browse the repository at this point in the history
* BUG Fixes cython in splitting

* REV Revert

* Revert "REV Revert"

This reverts commit d1cf3b1.

* WIP Uses signed char

* WIP Maybe use signed chars

* WIP const signed chars
  • Loading branch information
thomasjpfan authored and adrinjalali committed May 19, 2020
1 parent 04e485e commit 2431ea3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sklearn/ensemble/_hist_gradient_boosting/splitting.pyx
Expand Up @@ -134,7 +134,7 @@ cdef class Splitter:
const unsigned int [::1] n_bins_non_missing
unsigned char missing_values_bin_idx
const unsigned char [::1] has_missing_values
const char [::1] monotonic_cst
const signed char [::1] monotonic_cst
unsigned char hessians_are_constant
Y_DTYPE_C l2_regularization
Y_DTYPE_C min_hessian_to_split
Expand All @@ -150,7 +150,7 @@ cdef class Splitter:
const unsigned int [::1] n_bins_non_missing,
const unsigned char missing_values_bin_idx,
const unsigned char [::1] has_missing_values,
const char [::1] monotonic_cst,
const signed char [::1] monotonic_cst,
Y_DTYPE_C l2_regularization,
Y_DTYPE_C min_hessian_to_split=1e-3,
unsigned int min_samples_leaf=20,
Expand Down Expand Up @@ -410,7 +410,7 @@ cdef class Splitter:
split_info_struct split_info
split_info_struct * split_infos
const unsigned char [::1] has_missing_values = self.has_missing_values
const char [::1] monotonic_cst = self.monotonic_cst
const signed char [::1] monotonic_cst = self.monotonic_cst

with nogil:

Expand Down Expand Up @@ -496,7 +496,7 @@ cdef class Splitter:
Y_DTYPE_C sum_gradients,
Y_DTYPE_C sum_hessians,
Y_DTYPE_C value,
char monotonic_cst,
signed char monotonic_cst,
Y_DTYPE_C lower_bound,
Y_DTYPE_C upper_bound,
split_info_struct * split_info) nogil: # OUT
Expand Down Expand Up @@ -610,7 +610,7 @@ cdef class Splitter:
Y_DTYPE_C sum_gradients,
Y_DTYPE_C sum_hessians,
Y_DTYPE_C value,
char monotonic_cst,
signed char monotonic_cst,
Y_DTYPE_C lower_bound,
Y_DTYPE_C upper_bound,
split_info_struct * split_info) nogil: # OUT
Expand Down Expand Up @@ -723,7 +723,7 @@ cdef inline Y_DTYPE_C _split_gain(
Y_DTYPE_C sum_gradient_right,
Y_DTYPE_C sum_hessian_right,
Y_DTYPE_C loss_current_node,
char monotonic_cst,
signed char monotonic_cst,
Y_DTYPE_C lower_bound,
Y_DTYPE_C upper_bound,
Y_DTYPE_C l2_regularization) nogil:
Expand Down Expand Up @@ -820,4 +820,4 @@ cpdef inline Y_DTYPE_C compute_node_value(
elif value > upper_bound:
value = upper_bound

return value
return value

0 comments on commit 2431ea3

Please sign in to comment.