/ Build graph */ /
| 19 | /* Build graph */ |
| 20 | /************************************************************************/ |
| 21 | bool InMemoryGraph::Build(const GraphConfig& config) { |
| 22 | DXINFO("Build in memory graph..."); |
| 23 | |
| 24 | graph_builder_ = GraphBuilder::Create(config); |
| 25 | if (!graph_builder_) { |
| 26 | return false; |
| 27 | } |
| 28 | |
| 29 | post_builder_ = |
| 30 | PostBuilder::Create(graph_builder_->context_storage(), config); |
| 31 | if (!post_builder_) { |
| 32 | return false; |
| 33 | } |
| 34 | |
| 35 | if (!CheckSizeValid()) { |
| 36 | return false; |
| 37 | } |
| 38 | |
| 39 | PrintGraphTopo(); |
| 40 | |
| 41 | DXINFO("Done."); |
| 42 | return true; |
| 43 | } |
| 44 | |
| 45 | bool InMemoryGraph::CheckSizeValid() const { |
| 46 | // len(node_feat_list) <= len(context_list) |