pub fn min_axis<T: Reduce1<I>, const I: isize>(t: T) -> T::Reduced
Expand description

Reduces dimension I of the tensor by gathering the minimum value from that dimension.

Pytorch equivalent: t.amin(I)

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

Example:

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