| 58 | } |
| 59 | |
| 60 | void RandomWalkFlow::FillNodeFeature(Instance* inst, const std::string& name, |
| 61 | const vec_int_t& nodes, |
| 62 | bool add_self) const { |
| 63 | auto* node_feat_ptr = &inst->get_or_insert<csr_t>(name); |
| 64 | node_feat_ptr->clear(); |
| 65 | |
| 66 | std::vector<vec_pair_t> tmp_feats_list; |
| 67 | graph_client_.LookupNodeFeature(nodes, &tmp_feats_list); |
| 68 | |
| 69 | for (size_t i = 0; i < tmp_feats_list.size(); ++i) { |
| 70 | for (const auto& entry : tmp_feats_list[i]) { |
| 71 | node_feat_ptr->emplace(entry.first, entry.second); |
| 72 | } |
| 73 | |
| 74 | if (add_self) { |
| 75 | node_feat_ptr->emplace(nodes[i], 1.0); |
| 76 | } |
| 77 | |
| 78 | node_feat_ptr->add_row(); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | void RandomWalkFlow::FillEdgeAndLabel( |
| 83 | Instance* inst, const std::string& src_name, const std::string& dst_name, |
nothing calls this directly
no test coverage detected