"vscode:/vscode.git/clone" did not exist on "57daf9c9a6728d15fcc3ad66a9b5616162d9a37b"
Unverified Commit f4989867 authored by Mingbang Wang's avatar Mingbang Wang Committed by GitHub
Browse files

[GraphBolt] Add error messages for attribute size check (#7079)


Co-authored-by: default avatarMuhammed Fatih BALIN <m.f.balin@gmail.com>
parent 308f099b
......@@ -97,12 +97,21 @@ c10::intrusive_ptr<FusedCSCSamplingGraph> FusedCSCSamplingGraph::Create(
}
if (node_attributes.has_value()) {
for (const auto& pair : node_attributes.value()) {
TORCH_CHECK(pair.value().size(0) == indptr.size(0) - 1);
TORCH_CHECK(
pair.value().size(0) == indptr.size(0) - 1,
"Expected node_attribute.size(0) and num_nodes to be equal, "
"but node_attribute.size(0) was ",
pair.value().size(0), ", and num_nodes was ", indptr.size(0) - 1,
".");
}
}
if (edge_attributes.has_value()) {
for (const auto& pair : edge_attributes.value()) {
TORCH_CHECK(pair.value().size(0) == indices.size(0));
TORCH_CHECK(
pair.value().size(0) == indices.size(0),
"Expected edge_attribute.size(0) and num_edges to be equal, "
"but edge_attribute.size(0) was ",
pair.value().size(0), ", and num_edges was ", indices.size(0), ".");
}
}
return c10::make_intrusive<FusedCSCSamplingGraph>(
......
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