Unverified Commit 167536db authored by Quan (Andy) Gan's avatar Quan (Andy) Gan Committed by GitHub
Browse files

[Windows] Work around the bug from CL 19.10 (#2059)

* [Windows] Work around the bug from CL 19.10

* fix
parent a4a7e02f
......@@ -685,7 +685,10 @@ inline std::vector<T> ListValueToVector(const List<Value>& list) {
std::vector<T> ret;
ret.reserve(list.size());
for (Value val : list)
ret.push_back(val->data);
// (BarclayII) apparently MSVC 2017 CL 19.10 had trouble parsing
// ret.push_back(val->data)
// So I kindly tell it how to properly parse it.
ret.push_back(val->data.operator T());
return ret;
}
......
......@@ -268,7 +268,7 @@ template <typename Idx, typename FloatType>
void _TestCSRTopk(bool has_data) {
auto mat = CSR<Idx>(has_data);
FloatArray weight = NDArray::FromVector(
std::vector<FloatType>({.1, .0, -.1, .2, .5}));
std::vector<FloatType>({.1f, .0f, -.1f, .2f, .5f}));
// -.1, .2, .1, .0, .5
IdArray rows = NDArray::FromVector(std::vector<Idx>({0, 3}));
......@@ -315,7 +315,7 @@ template <typename Idx, typename FloatType>
void _TestCOOTopk(bool has_data) {
auto mat = COO<Idx>(has_data);
FloatArray weight = NDArray::FromVector(
std::vector<FloatType>({.1, .0, -.1, .2, .5}));
std::vector<FloatType>({.1f, .0f, -.1f, .2f, .5f}));
// -.1, .2, .1, .0, .5
IdArray rows = NDArray::FromVector(std::vector<Idx>({0, 3}));
......
......@@ -69,7 +69,7 @@ TEST(SampleUtilsTest, TestWithReplacement) {
template <typename Idx, typename DType>
void _TestWithoutReplacementOrder(RandomEngine *re) {
// TODO(BarclayII): is there a reliable way to do this test?
std::vector<DType> _prob = {1e6, 1e-6, 1e-2, 1e2};
std::vector<DType> _prob = {1e6f, 1e-6f, 1e-2f, 1e2f};
FloatArray prob = NDArray::FromVector(_prob);
std::vector<Idx> ground_truth = {0, 3, 2, 1};
......
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