(Tensor) the input tensor.
(int) the k in "top-k"
(int, optional) the dimension to sort along
(bool, optional) controls whether to return largest or smallest elements
(bool, optional) controls whether to return the elements in sorted order
k largest elements of the given
input tensor along
a given dimension.
dim is not given, the last dimension of the
input is chosen.
FALSE then the
k smallest elements are returned.
A namedtuple of
(values, indices) is returned, where the
indices are the indices
of the elements in the original
The boolean option
TRUE, will make sure that the returned
k elements are themselves sorted