MCPcopy Create free account
hub / github.com/Tencent/embedx / FillNodeFeature

Method FillNodeFeature

src/model/data_flow/random_walk_flow.cc:60–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void 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
82void RandomWalkFlow::FillEdgeAndLabel(
83 Instance* inst, const std::string& src_name, const std::string& dst_name,

Callers

nothing calls this directly

Calls 4

emplaceMethod · 0.80
add_rowMethod · 0.80
clearMethod · 0.45
LookupNodeFeatureMethod · 0.45

Tested by

no test coverage detected