fn
argmin
→Tensorargmin(x: Tensor, dim: _int | None = None, keepdim: _bool = False)Return the indices of the minimum values along dim.
Symmetric to argmax — for each slice along dim the index of
the smallest element is produced, with ties broken by returning the first
occurrence in row-major order. dim=None reduces over the flattened
tensor.
Parameters
xTensorInput tensor.
dimint= NoneReduction dimension.
None reduces over all elements.keepdimbool= FalseWhether to keep the reduced dim with size 1.
Returns
Tensorint64 index tensor.
Notes
Examples
>>> import lucid
>>> x = lucid.tensor([3.0, 1.0, 4.0, 1.0])
>>> lucid.argmin(x)
Tensor(1)