Return a (values, indices) pair of the modal value of each slice along dim.
Parameters
inputTensorInput tensor of a real or boolean dtype.
dimintDimension to reduce. Defaults to
-1.keepdimboolWhether the output tensors have
dim retained with size 1.
Defaults to False.Returns
tuple of Tensor(values, indices) named tuple of modal values and their int64
indices along dim.
Examples
>>> import lucid
>>> v, idx = lucid.mode(lucid.tensor([[1, 2, 2], [3, 1, 3]]))
>>> v
tensor([2, 3], dtype=lucid.int64)