@@ -166,20 +166,17 @@ static PyObject * _make_nda_from_csr(daal::data_management::NumericTablePtr * pt
166166 size_t n = csr_ptr->getDataSize ();
167167 T * data_copy = static_cast <T *>(daal::services::daal_malloc (n * sizeof (T)));
168168 DAAL4PY_CHECK_MALLOC (data_copy);
169- daal::services::internal::daal_memcpy_s (data_ptr,
170- sizeof (T) * n,
171- data_copy,
172- sizeof (T) * n);
173- PyObject * py_data = _make_npy_from_data<T, NPTYPE>(data_copy, n);
174- n = csr_ptr->getNumberOfColumns ();
169+ daal::services::internal::daal_memcpy_s (data_ptr, sizeof (T) * n, data_copy, sizeof (T) * n);
170+ PyObject * py_data = _make_npy_from_data<T, NPTYPE>(data_copy, n);
171+ n = csr_ptr->getNumberOfColumns ();
175172 size_t * col_indices_copy = static_cast <size_t *>(daal::services::daal_malloc (n * sizeof (size_t )));
176173 DAAL4PY_CHECK_MALLOC (col_indices_copy);
177174 for (size_t i = 0 ; i < n; ++i)
178175 {
179176 col_indices_copy[i] = col_indices_ptr[i] - 1 ;
180177 }
181- PyObject * py_col = _make_npy_from_data<size_t , NPTYPE>(col_indices_copy, n);
182- n = csr_ptr->getNumberOfRows ();
178+ PyObject * py_col = _make_npy_from_data<size_t , NPTYPE>(col_indices_copy, n);
179+ n = csr_ptr->getNumberOfRows ();
183180 size_t * row_offsets_copy = static_cast <size_t *>(daal::services::daal_malloc (n * sizeof (size_t )));
184181 DAAL4PY_CHECK_MALLOC (row_offsets_copy);
185182 for (size_t i = 0 ; i < n; ++i)
@@ -831,12 +828,12 @@ extern "C"
831828bool c_assert_all_finite (const data_or_file & t, bool allowNaN, char dtype)
832829{
833830 bool result = false ;
834- auto tab = get_table (t);
831+ auto tab = get_table (t);
835832 switch (dtype)
836833 {
837- case 0 : result = daal::data_management::internal::allValuesAreFinite<double >(*tab, allowNaN); break ;
838- case 1 : result = daal::data_management::internal::allValuesAreFinite<float >(*tab, allowNaN); break ;
839- default : throw std::invalid_argument (" Invalid data type specified." );
834+ case 0 : result = daal::data_management::internal::allValuesAreFinite<double >(*tab, allowNaN); break ;
835+ case 1 : result = daal::data_management::internal::allValuesAreFinite<float >(*tab, allowNaN); break ;
836+ default : throw std::invalid_argument (" Invalid data type specified." );
840837 }
841838 return result;
842839}
@@ -859,27 +856,27 @@ double c_roc_auc_score(data_or_file & y_true, data_or_file & y_test)
859856 const size_t col_test = y_test.table ->getNumberOfColumns ();
860857 const size_t row_test = y_test.table ->getNumberOfRows ();
861858
862- if (row_true != 1 || row_test != 1 || col_true != col_test) {
859+ if (row_true != 1 || row_test != 1 || col_true != col_test)
860+ {
863861 PyErr_SetString (PyExc_RuntimeError, " Unknown shape data" );
864862 return NULL ;
865863 }
866864
867865 auto table_true = get_table (y_true);
868866 auto table_test = get_table (y_test);
869- auto type = (*table_test->getDictionary ())[0 ].indexType ;
870- if (type == daal::data_management::data_feature_utils::DAAL_FLOAT64 ||
871- type == daal::data_management::data_feature_utils::DAAL_INT64_S ||
872- type == daal::data_management::data_feature_utils::DAAL_INT64_U)
867+ auto type = (*table_test->getDictionary ())[0 ].indexType ;
868+ if (type == daal::data_management::data_feature_utils::DAAL_FLOAT64 || type == daal::data_management::data_feature_utils::DAAL_INT64_S || type == daal::data_management::data_feature_utils::DAAL_INT64_U)
873869 {
874870 return daal::data_management::internal::rocAucScore<double >(table_true, table_test);
875- } else if (type == daal::data_management::data_feature_utils::DAAL_FLOAT32 ||
876- type == daal::data_management::data_feature_utils::DAAL_INT32_S ||
877- type == daal::data_management::data_feature_utils::DAAL_INT32_U)
871+ }
872+ else if (type == daal::data_management::data_feature_utils::DAAL_FLOAT32 || type == daal::data_management::data_feature_utils::DAAL_INT32_S || type == daal::data_management::data_feature_utils::DAAL_INT32_U)
878873 {
879874 return daal::data_management::internal::rocAucScore<float >(table_true, table_test);
880875 }
881876 PyErr_SetString (PyExc_RuntimeError, " Unknown shape data" );
882877 return NULL ;
878+ #else
879+ return NULL ;
883880#endif
884881}
885882
0 commit comments