Function amdinfer::pre_post::getTopK

Function Documentation

inline std::vector<int> amdinfer::pre_post::getTopK(const double *d, size_t size, int k)

After running softmax, get the labels associated with the top k values.

Parameters
  • d – pointer to the data

  • size – number of elements in the data

  • k – number of top elements to return

Returns

std::vector<int>