latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.argmin
- tensorplay.functional.argmin(input, dim=None, keepdim=False) LongTensor[source]
Returns the indices of the minimum value(s) of the flattened tensor or along a dimension
This is the second value returned by
tensorplay.min(). See its documentation for the exact semantics of this method.Note
If there are multiple minimal values then the indices of the first minimal value are returned.
- Parameters:
input (Tensor) – the input tensor.
dim – the dimension to reduce.
Example:
>>> a = tensorplay.randn(4, 4) >>> a tensor([[ 0.1139, 0.2254, -0.1381, 0.3687], [ 1.0100, -1.1975, -0.0102, -0.4732], [-0.9240, 0.1207, -0.7506, -1.0213], [ 1.7809, -1.2960, 0.9384, 0.1438]]) >>> tensorplay.argmin(a) tensor(13) >>> tensorplay.argmin(a, dim=1) tensor([ 2, 1, 3, 1]) >>> tensorplay.argmin(a, dim=1, keepdim=True) tensor([[2], [1], [3], [1]])
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

