Skip to content
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

Replace cpdef variables with cdef variables. #5145

Merged
merged 3 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/cuml/decomposition/pca.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ class PCA(UniversalBase,
return algo_map[algorithm]

def _build_params(self, n_rows, n_cols):
cpdef paramsPCA *params = new paramsPCA()
cdef paramsPCA *params = new paramsPCA()
params.n_components = self.n_components_
params.n_rows = n_rows
params.n_cols = n_cols
Expand Down Expand Up @@ -582,7 +582,7 @@ class PCA(UniversalBase,
cdef uintptr_t _trans_input_ptr = X_m.ptr

# todo: check n_cols and dtype
cpdef paramsPCA params
cdef paramsPCA params
params.n_components = self.n_components_
params.n_rows = n_rows
params.n_cols = self.n_features_in_
Expand Down Expand Up @@ -678,7 +678,7 @@ class PCA(UniversalBase,
cdef uintptr_t input_ptr = X_m.ptr

# todo: check dtype
cpdef paramsPCA params
cdef paramsPCA params
params.n_components = self.n_components_
params.n_rows = n_rows
params.n_cols = n_cols
Expand Down
2 changes: 1 addition & 1 deletion python/cuml/decomposition/pca_mg.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class PCAMG(BaseDecompositionMG, PCA):
return algo_map[algorithm]

def _build_params(self, n_rows, n_cols):
cpdef paramsPCAMG *params = new paramsPCAMG()
cdef paramsPCAMG *params = new paramsPCAMG()
params.n_components = self.n_components_
params.n_rows = n_rows
params.n_cols = n_cols
Expand Down
6 changes: 3 additions & 3 deletions python/cuml/decomposition/tsvd.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class TruncatedSVD(UniversalBase,
return algo_map[algorithm]

def _build_params(self, n_rows, n_cols):
cpdef paramsTSVD *params = new paramsTSVD()
cdef paramsTSVD *params = new paramsTSVD()
params.n_components = self.n_components
params.n_rows = n_rows
params.n_cols = n_cols
Expand Down Expand Up @@ -395,7 +395,7 @@ class TruncatedSVD(UniversalBase,
convert_to_dtype=(dtype if convert_dtype
else None))

cpdef paramsTSVD params
cdef paramsTSVD params
params.n_components = self.n_components
params.n_rows = n_rows
params.n_cols = self.n_features_in_
Expand Down Expand Up @@ -447,7 +447,7 @@ class TruncatedSVD(UniversalBase,
else None),
check_cols=self.n_features_in_)

cpdef paramsTSVD params
cdef paramsTSVD params
params.n_components = self.n_components
params.n_rows = n_rows
params.n_cols = self.n_features_in_
Expand Down
2 changes: 1 addition & 1 deletion python/cuml/decomposition/tsvd_mg.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class TSVDMG(BaseDecompositionMG, TruncatedSVD):
super(TSVDMG, self).__init__(**kwargs)

def _build_params(self, n_rows, n_cols):
cpdef paramsTSVDMG *params = new paramsTSVDMG()
cdef paramsTSVDMG *params = new paramsTSVDMG()
params.n_components = self.n_components_
params.n_rows = n_rows
params.n_cols = n_cols
Expand Down
4 changes: 2 additions & 2 deletions python/cuml/fil/fil.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ cdef class TreeliteModel():
handle : ModelHandle
Opaque pointer to Treelite model
"""
cpdef ModelHandle handle
cpdef bool owns_handle
cdef ModelHandle handle
cdef bool owns_handle

def __cinit__(self, owns_handle=True):
"""If owns_handle is True, free the handle's model in destructor.
Expand Down