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

Function topKMagnitudes

samples/common/common.h:442–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440// Returns indices of highest K magnitudes in v.
441template <typename T>
442std::vector<size_t> topKMagnitudes(const std::vector<T>& v, const size_t k)
443{
444 std::vector<size_t> indices = samplesCommon::argMagnitudeSort(v.cbegin(), v.cend());
445 indices.resize(k);
446 return indices;
447}
448
449template <typename T>
450bool readASCIIFile(const std::string& fileName, const size_t size, std::vector<T>& out)

Callers

nothing calls this directly

Calls 2

argMagnitudeSortFunction · 0.85
resizeMethod · 0.45

Tested by

no test coverage detected