---
title: "argmin(alongAxis:keepRank:)"
framework: coreml
role: symbol
role_heading: Instance Method
path: "coreml/mltensor/argmin(alongaxis:keeprank:)"
---

# argmin(alongAxis:keepRank:)

Returns the indices of the minimum values along the specified axis.

## Declaration

```swift
func argmin(alongAxis axis: Int, keepRank: Bool = false) -> MLTensor
```

## Parameters

- `axis`: The axis to reduce.
- `keepRank`: A Boolean indicating whether to keep the reduced axis or not. The default value is false.

## Return Value

Return Value The reduced tensor.

## Discussion

Discussion let x = MLTensor(shape: [3, 2], scalars: [2, 3, 4, 5, 6, 7], scalarType: Float.self) let y = x.argmin(alongAxis: 0) y.shape // is [2] y.scalarType // is Int32 await y.shapedArray(of: Int32.self) // is 0 0

## See Also

### Accessing the indicies

- [argmax()](coreml/mltensor/argmax().md)
- [argmax(alongAxis:keepRank:)](coreml/mltensor/argmax(alongaxis:keeprank:).md)
- [argmin()](coreml/mltensor/argmin().md)
- [argsort(alongAxis:descendingOrder:)](coreml/mltensor/argsort(alongaxis:descendingorder:).md)
