| 152 | } |
| 153 | |
| 154 | void TestMeanAggregateNodes(Client* client) { |
| 155 | AggregatingRequest req("movie", "MeanAggregator"); |
| 156 | int64_t ids[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; |
| 157 | int32_t segment_ids[10] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 3}; |
| 158 | int32_t num_segments = 4; |
| 159 | req.Set(ids, segment_ids, 10, 4); |
| 160 | |
| 161 | AggregatingResponse res; |
| 162 | Status s = client->Aggregating(&req, &res); |
| 163 | std::cout << "MeanAggregateNodes: " << s.ToString() << std::endl; |
| 164 | |
| 165 | int32_t size = res.NumSegments(); |
| 166 | |
| 167 | if (res.EmbeddingDim() > 0) { |
| 168 | int32_t float_num = res.EmbeddingDim(); |
| 169 | const float* floats = res.Embeddings(); |
| 170 | std::cout << "floats: "; |
| 171 | for (int32_t i = 0; i < size * float_num; ++i) { |
| 172 | std::cout << floats[i] << ' '; |
| 173 | } |
| 174 | std::cout << std::endl; |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | void TestMaxAggregateNodes(Client* client) { |
| 179 | AggregatingRequest req("movie", "MaxAggregator"); |
no test coverage detected