Skip to content

Commit

Permalink
Fix get_decision_function (#645)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlnx authored May 12, 2021
1 parent 0bed689 commit edafa1d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion onedal/svm/backend/svm_py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ PyObject *svm_infer<Task>::get_labels() {
// attributes from infer_result
template <typename Task>
PyObject *svm_infer<Task>::get_decision_function() {
return convert_to_numpy(infer_result_.get_decision_function());
if constexpr (std::is_same_v<Task, svm::task::classification>) {
return convert_to_numpy(infer_result_.get_decision_function());
}
return nullptr;
}

template class ONEDAL_BACKEND_EXPORT svm_model<svm::task::classification>;
Expand Down

0 comments on commit edafa1d

Please sign in to comment.