N-dimensional tensor. Owns its data buffer exclusively; a DeviceBackend* is injected (not owned) – th...
Definition tensor.hpp:29
Definition acquisition_functions.hpp:16
TopKResult top_k(const Tensor &input, int64_t k, bool largest=true)
Selects the k largest (or smallest) entries of every row along the last dimension.
top_k()'s result: the selected values and their positions along the last dimension.
Definition top_k.hpp:14
Tensor indices
Shape (..., k): each value's index within its row, as a whole-number float.
Definition top_k.hpp:18
Tensor values
Shape (..., k): each row's k best values, best first.
Definition top_k.hpp:16
N-dimensional tensor – owns a buffer via DeviceBackend*, RAII (Rule of Five).