"...git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "ddda85b06061fe11ce42e1f636c101b651a7ef19"
Commit 88b84436 authored by Guolin Ke's avatar Guolin Ke Committed by GitHub
Browse files

fix bug in CSR get row function

parent f56699eb
...@@ -660,7 +660,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices, ...@@ -660,7 +660,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
std::vector<std::pair<int, double>> ret; std::vector<std::pair<int, double>> ret;
int64_t start = ptr_indptr[idx]; int64_t start = ptr_indptr[idx];
int64_t end = ptr_indptr[idx + 1]; int64_t end = ptr_indptr[idx + 1];
for (int64_t i = start; i <= end; ++i) { for (int64_t i = start; i < end; ++i) {
ret.emplace_back(indices[i], data_ptr[i]); ret.emplace_back(indices[i], data_ptr[i]);
} }
return ret; return ret;
...@@ -671,7 +671,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices, ...@@ -671,7 +671,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
std::vector<std::pair<int, double>> ret; std::vector<std::pair<int, double>> ret;
int64_t start = ptr_indptr[idx]; int64_t start = ptr_indptr[idx];
int64_t end = ptr_indptr[idx + 1]; int64_t end = ptr_indptr[idx + 1];
for (int64_t i = start; i <= end; ++i) { for (int64_t i = start; i < end; ++i) {
ret.emplace_back(indices[i], data_ptr[i]); ret.emplace_back(indices[i], data_ptr[i]);
} }
return ret; return ret;
...@@ -685,7 +685,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices, ...@@ -685,7 +685,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
std::vector<std::pair<int, double>> ret; std::vector<std::pair<int, double>> ret;
int64_t start = ptr_indptr[idx]; int64_t start = ptr_indptr[idx];
int64_t end = ptr_indptr[idx + 1]; int64_t end = ptr_indptr[idx + 1];
for (int64_t i = start; i <= end; ++i) { for (int64_t i = start; i < end; ++i) {
ret.emplace_back(indices[i], data_ptr[i]); ret.emplace_back(indices[i], data_ptr[i]);
} }
return ret; return ret;
...@@ -696,7 +696,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices, ...@@ -696,7 +696,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
std::vector<std::pair<int, double>> ret; std::vector<std::pair<int, double>> ret;
int64_t start = ptr_indptr[idx]; int64_t start = ptr_indptr[idx];
int64_t end = ptr_indptr[idx + 1]; int64_t end = ptr_indptr[idx + 1];
for (int64_t i = start; i <= end; ++i) { for (int64_t i = start; i < end; ++i) {
ret.emplace_back(indices[i], data_ptr[i]); ret.emplace_back(indices[i], data_ptr[i]);
} }
return ret; return ret;
...@@ -774,4 +774,4 @@ std::vector<double> SampleFromOneColumn(const std::vector<std::pair<int, double> ...@@ -774,4 +774,4 @@ std::vector<double> SampleFromOneColumn(const std::vector<std::pair<int, double>
} }
} }
return ret; return ret;
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment