| 176 | } |
| 177 | |
| 178 | void 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 | |
| 202 | void TestMinAggregateNodes(Client* client) { |
| 203 | AggregatingRequest req("movie", "MinAggregator"); |
no test coverage detected