MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / print_context

Function print_context

test/topk.cpp:351–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349 });
350
351string print_context(int idx0, int idx1, const vector<float>& val,
352 const vector<unsigned>& idx) {
353 stringstream ss;
354 if (idx0 > 3 && idx1 > 3) {
355 for (int i = idx0 - 3; i < idx0 + 3; i++) {
356 ss << i << ": " << val[i] << " " << idx[i] << "\n";
357 }
358 } else {
359 int end = min(6, idx0 + 3);
360 for (int i = 0; i < end; i++) {
361 ss << i << ": " << val[i] << " " << idx[i] << "\n";
362 }
363 }
364 return ss.str();
365}
366
367TEST_P(TopKParams, CPP) {
368 topk_params params = GetParam();

Callers 1

TEST_PFunction · 0.85

Calls 1

minFunction · 0.70

Tested by

no test coverage detected