Function dfdx::tensor_ops::min_axis
source · [−]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]);