Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
167536db
Unverified
Commit
167536db
authored
Aug 19, 2020
by
Quan (Andy) Gan
Committed by
GitHub
Aug 19, 2020
Browse files
[Windows] Work around the bug from CL 19.10 (#2059)
* [Windows] Work around the bug from CL 19.10 * fix
parent
a4a7e02f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
include/dgl/runtime/container.h
include/dgl/runtime/container.h
+4
-1
tests/cpp/test_rowwise.cc
tests/cpp/test_rowwise.cc
+2
-2
tests/cpp/test_sampler.cc
tests/cpp/test_sampler.cc
+1
-1
No files found.
include/dgl/runtime/container.h
View file @
167536db
...
...
@@ -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
;
}
...
...
tests/cpp/test_rowwise.cc
View file @
167536db
...
...
@@ -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
>
({
.1
f
,
.0
f
,
-
.1
f
,
.2
f
,
.5
f
}));
// -.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
>
({
.1
f
,
.0
f
,
-
.1
f
,
.2
f
,
.5
f
}));
// -.1, .2, .1, .0, .5
IdArray
rows
=
NDArray
::
FromVector
(
std
::
vector
<
Idx
>
({
0
,
3
}));
...
...
tests/cpp/test_sampler.cc
View file @
167536db
...
...
@@ -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
=
{
1e6
f
,
1e-6
f
,
1e-2
f
,
1e2
f
};
FloatArray
prob
=
NDArray
::
FromVector
(
_prob
);
std
::
vector
<
Idx
>
ground_truth
=
{
0
,
3
,
2
,
1
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment