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
66182b28
Unverified
Commit
66182b28
authored
Apr 25, 2021
by
Jinjing Zhou
Committed by
GitHub
Apr 25, 2021
Browse files
[Serialization] Better error message when idx_list out of bound (#2848)
Co-authored-by:
Minjie Wang
<
wmjlyjemaine@gmail.com
>
parent
c37e0364
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
src/graph/serialize/dglgraph_serialize.cc
src/graph/serialize/dglgraph_serialize.cc
+5
-1
src/graph/serialize/heterograph_serialize.cc
src/graph/serialize/heterograph_serialize.cc
+5
-1
No files found.
src/graph/serialize/dglgraph_serialize.cc
View file @
66182b28
...
@@ -163,7 +163,11 @@ StorageMetaData LoadDGLGraphs(const std::string &filename,
...
@@ -163,7 +163,11 @@ StorageMetaData LoadDGLGraphs(const std::string &filename,
// Would be better if idx_list is sorted. However the returned the graphs
// Would be better if idx_list is sorted. However the returned the graphs
// should be the same order as the idx_list
// should be the same order as the idx_list
for
(
uint64_t
i
=
0
;
i
<
idx_list
.
size
();
++
i
)
{
for
(
uint64_t
i
=
0
;
i
<
idx_list
.
size
();
++
i
)
{
fs
->
Seek
(
graph_indices
[
idx_list
[
i
]]);
auto
gid
=
idx_list
[
i
];
CHECK
((
gid
<
graph_indices
.
size
())
&&
(
gid
>=
0
))
<<
"ID "
<<
gid
<<
" in idx_list is out of bound. Please check your idx_list."
;
fs
->
Seek
(
graph_indices
[
gid
]);
GraphData
gdata
=
GraphData
::
Create
();
GraphData
gdata
=
GraphData
::
Create
();
GraphDataObject
*
gdata_ptr
=
GraphDataObject
*
gdata_ptr
=
const_cast
<
GraphDataObject
*>
(
gdata
.
as
<
GraphDataObject
>
());
const_cast
<
GraphDataObject
*>
(
gdata
.
as
<
GraphDataObject
>
());
...
...
src/graph/serialize/heterograph_serialize.cc
View file @
66182b28
...
@@ -169,7 +169,11 @@ std::vector<HeteroGraphData> LoadHeteroGraphs(const std::string &filename,
...
@@ -169,7 +169,11 @@ std::vector<HeteroGraphData> LoadHeteroGraphs(const std::string &filename,
// Would be better if idx_list is sorted. However the returned the graphs
// Would be better if idx_list is sorted. However the returned the graphs
// should be the same order as the idx_list
// should be the same order as the idx_list
for
(
uint64_t
i
=
0
;
i
<
idx_list
.
size
();
++
i
)
{
for
(
uint64_t
i
=
0
;
i
<
idx_list
.
size
();
++
i
)
{
fs
->
Seek
(
graph_indices
[
idx_list
[
i
]]);
auto
gid
=
idx_list
[
i
];
CHECK
((
gid
<
graph_indices
.
size
())
&&
(
gid
>=
0
))
<<
"ID "
<<
gid
<<
" in idx_list is out of bound. Please check your idx_list."
;
fs
->
Seek
(
graph_indices
[
gid
]);
HeteroGraphData
gdata
=
HeteroGraphData
::
Create
();
HeteroGraphData
gdata
=
HeteroGraphData
::
Create
();
auto
hetero_data
=
gdata
.
sptr
();
auto
hetero_data
=
gdata
.
sptr
();
fs
->
Read
(
&
hetero_data
);
fs
->
Read
(
&
hetero_data
);
...
...
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