MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / argMagnitudeSort

Function argMagnitudeSort

samples/common/common.h:399–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397//! Return vector of indices that puts magnitudes of sequence in descending order.
398template <class Iter>
399std::vector<size_t> argMagnitudeSort(Iter begin, Iter end)
400{
401 std::vector<size_t> indices(end - begin);
402 std::iota(indices.begin(), indices.end(), 0);
403 std::sort(indices.begin(), indices.end(), [&begin](size_t i, size_t j) { return std::abs(begin[j]) < std::abs(begin[i]); });
404 return indices;
405}
406
407inline bool readReferenceFile(const std::string& fileName, std::vector<std::string>& refVector)
408{

Callers 3

classifyFunction · 0.85
topKMagnitudesFunction · 0.85
verifyOutputMethod · 0.85

Calls 1

absFunction · 0.70

Tested by

no test coverage detected