pub fn min<T: Reduce<Axes>, Axes>(t: T) -> T::Reduced
Expand description

Reduces Axes of the tensor by gathering the minimum value from the axes.

Pytorch equivalent: t.amin(Axes)

NOTE This evenly distributes gradients between all equal minimum values, instead of only exactly 1 value.

Example:

let t = tensor([[1.0, 2.0, 3.0], [-1.0, -2.0, -3.0]]);
let r: Tensor1D<2> = t.min();
assert_eq!(r.data(), &[1.0, -3.0]);

Reducing 2 axes:

let r: Tensor0D = t.min();
assert_eq!(r.data(), &-3.0);