MCPcopy Create free account
hub / github.com/alibaba/graph-learn / TestMinAggregateNodes

Function TestMinAggregateNodes

graphlearn/src/service/test/client_test.cpp:202–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void TestMinAggregateNodes(Client* client) {
203 AggregatingRequest req("movie", "MinAggregator");
204 int64_t ids[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
205 int32_t segment_ids[10] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 3};
206 int32_t num_segments = 4;
207 req.Set(ids, segment_ids, 10, 4);
208
209 AggregatingResponse res;
210 Status s = client->Aggregating(&req, &res);
211 std::cout << "MinAggregateNodes: " << s.ToString() << std::endl;
212
213 int32_t size = res.NumSegments();
214
215 if (res.EmbeddingDim() > 0) {
216 int32_t float_num = res.EmbeddingDim();
217 const float* floats = res.Embeddings();
218 std::cout << "floats: ";
219 for (int32_t i = 0; i < size * float_num; ++i) {
220 std::cout << floats[i] << ' ';
221 }
222 std::cout << std::endl;
223 }
224}
225
226void TestProdAggregateNodes(Client* client) {
227 AggregatingRequest req("movie", "ProdAggregator");

Callers 1

mainFunction · 0.85

Calls 5

EmbeddingDimMethod · 0.80
EmbeddingsMethod · 0.80
SetMethod · 0.45
ToStringMethod · 0.45
NumSegmentsMethod · 0.45

Tested by

no test coverage detected