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

Function TestMaxAggregateNodes

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

Source from the content-addressed store, hash-verified

176}
177
178void TestMaxAggregateNodes(Client* client) {
179 AggregatingRequest req("movie", "MaxAggregator");
180 int64_t ids[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
181 int32_t segment_ids[10] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 3};
182 int32_t num_segments = 4;
183 req.Set(ids, segment_ids, 10, 4);
184
185 AggregatingResponse res;
186 Status s = client->Aggregating(&req, &res);
187 std::cout << "MaxAggregateNodes: " << s.ToString() << std::endl;
188
189 int32_t size = res.NumSegments();
190
191 if (res.EmbeddingDim() > 0) {
192 int32_t float_num = res.EmbeddingDim();
193 const float* floats = res.Embeddings();
194 std::cout << "floats: ";
195 for (int32_t i = 0; i < size * float_num; ++i) {
196 std::cout << floats[i] << ' ';
197 }
198 std::cout << std::endl;
199 }
200}
201
202void TestMinAggregateNodes(Client* client) {
203 AggregatingRequest req("movie", "MinAggregator");

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