Poplar and PopLibs
TopK.hpp File Reference

Functions for finding the top k elements. More...

#include <poplar/Graph.hpp>
#include <poplar/Program.hpp>
#include <poplar/Tensor.hpp>
#include <popops/SortOrder.hpp>

Go to the source code of this file.

Classes

struct  popops::TopKParams
 Parameters for topK* APIs. More...
 

Namespaces

namespace  popops
 Common functions, such as elementwise and reductions.
 

Functions

poplar::Tensor popops::createTopKInput (poplar::Graph &graph, const poplar::Type &type, const std::vector< std::size_t > &shape, const TopKParams &params, const poplar::DebugContext &debugContext={})
 Create an return a new tensor laid out optimally to be used as an input to a topK operation with the given parameters. More...
 
poplar::Tensor popops::topK (poplar::Graph &graph, poplar::program::Sequence &prog, const poplar::Tensor &t, const TopKParams &params, const poplar::DebugContext &debugContext={})
 Return the top k values in the innermost dimension of a tensor. More...
 
std::pair< poplar::Tensor, poplar::Tensorpopops::topKKeyValue (poplar::Graph &graph, poplar::program::Sequence &prog, const poplar::Tensor &keys, const poplar::Tensor &values, const TopKParams &params, const poplar::DebugContext &debugContext={})
 Return the top k values in the innermost dimension of a tensor along with the permutation of another tensor with respect to the values. More...
 
std::pair< poplar::Tensor, poplar::Tensorpopops::topKWithPermutation (poplar::Graph &graph, poplar::program::Sequence &prog, const poplar::Tensor &t, const TopKParams &params, const poplar::DebugContext &debugContext={})
 Return the top k values in the innermost dimension of a tensor along with the indices of those values in the input tensor in the innermost dimension. More...
 

Detailed Description

Functions for finding the top k elements.