---
title: "argSort(_:axisTensor:descending:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/argsort(_:axistensor:descending:name:)"
---

# argSort(_:axisTensor:descending:name:)

Computes the indices that sort the elements of the input tensor along the specified axis.

## Declaration

```swift
func argSort(_ tensor: MPSGraphTensor, axisTensor: MPSGraphTensor, descending: Bool, name: String?) -> MPSGraphTensor
```

## Parameters

- `tensor`: The input tensor
- `axisTensor`: The tensor dimension over which you sort the tensor
- `descending`: If true, reverse the sort direction
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object with 32-bit integer data type
