---
title: argmin()
framework: coreml
role: symbol
role_heading: Instance Method
path: coreml/mltensor/argmin()
---

# argmin()

Returns the index of the minimum value of the flattened scalars.

## Declaration

```swift
func argmin() -> MLTensor
```

## Discussion

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

## See Also

### Accessing the indicies

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