powered by
Argsort
torch_argsort(self, dim = -1L, descending = FALSE)
(Tensor) the input tensor.
(int, optional) the dimension to sort along
(bool, optional) controls the sorting order (ascending or descending)
Returns the indices that sort a tensor along a given dimension in ascending order by value.
This is the second value returned by torch_sort. See its documentation for the exact semantics of this method.
torch_sort
if (torch_is_installed()) { a = torch_randn(c(4, 4)) a torch_argsort(a, dim=1) }
Run the code above in your browser using DataLab