Backends/SiaNet.Backend.Torch/TypeGeneration.cs
/// <summary>
///   Sorts the elements of the tensor along the given dimension.
/// </summary>
/// <param name="dimension">The dimension to sort along.</param>
/// <param name="descending">0 if ascending, 1 if descending.</param>
/// <returns>A tuple containing the values and indices of the sorted elements.</returns>
Sorts the elements of the tensor along the given dimension.
Sorts the elements of the tensor along the given dimension .
public System.Tuple<DoubleTensor, LongTensor> Sort (int dimension, bool descending)
        {
            var values = new DoubleTensor ();
            var indices = new LongTensor ();
            THDoubleTensor_sort (values.handle, indices.handle, this.handle, dimension, descending?1:0);
            return new System.Tuple<DoubleTensor, LongTensor>(values, indices);
        }
public System . Tuple < DoubleTensor , LongTensor > Sort ( int dimension , bool descending ) { var values = new DoubleTensor ( ) ; var indices = new LongTensor ( ) ; THDoubleTensor_sort ( values . handle , indices . handle , this . handle , dimension , descending ? 1 : 0 ) ; return new System . Tuple < DoubleTensor , LongTensor > ( values , indices ) ; }
Sorts the elements of the tensor along the given dimension.
Sorts the elements of the tensor along the given dimension .
A tuple containing the values and indices of the sorted elements.
A tuple containing the values and indices of the sorted elements .
dimension
int
The dimension to sort along.
The dimension to sort along .
descending
bool
0 if ascending, 1 if descending.
0 if ascending 1 if descending .