Trait dfdx::devices::Reduce1Axis
source · [−]pub trait Reduce1Axis<T: CountElements, R: CountElements, const I: isize>: AllocateZeros + ForEachBroadcast1<R, T, I> {
fn reduce_into<F>(inp: &T, out: &mut R, f: F)
where
F: Copy + FnMut(T::Dtype, T::Dtype) -> T::Dtype;
fn reduce<F>(inp: &T, f: F) -> Box<R>
where
F: Copy + FnMut(T::Dtype, T::Dtype) -> T::Dtype,
{ ... }
}
Expand description
Reduce the I
th axis of T
. For example given T of shape (M, N, O),
you can reduce:
- the 0th axis (M) to give a shape of (N, O)
- the 1st axis (N) to give a shape of (M, O)
- the 2nd axis (O) to give a shape of (M, N)