# tensorplay.functional.argmin Source: https://www.tensorplay.cn/docs/generated/tensorplay.functional.argmin.html ```python tensorplay.functional.argmin(input, dim=None, keepdim=False) → LongTensor ``` 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()](/docs/generated/tensorplay.min.html#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](/docs/generated/tensorplay.Tensor.html#tensorplay.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]]) ```