dfdx 0.13.0

Ergonomic auto differentiation in Rust, with pytorch like apis.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::{shapes::Dtype, tensor::Cpu};

impl<E: Dtype> super::AxpyKernel<E> for Cpu {
    fn forward(
        &self,
        a: &mut Self::Vec,
        alpha: E,
        b: &Self::Vec,
        beta: E,
    ) -> Result<(), Self::Err> {
        for (a_i, b_i) in a.iter_mut().zip(b.iter()) {
            *a_i = *a_i * alpha + *b_i * beta;
        }
        Ok(())
    }
}