FL03 / acme

Acme aims to be a complete auto differentiation system written in Rust.
https://crates.io/crates/acme
Apache License 2.0
3 stars 0 forks source link

Implement a gradient macro #54

Closed FL03 closed 6 months ago

FL03 commented 8 months ago

Considering certain limitations of Rust when using procedural macros, an attribute macro will be better suited as they are permitted the full scope of whatever logic is encompassed by the function definition.

Usage

use acme::grad;

#[grad]
fn add(x: f64, y: f64) -> f64 {
    x + y
}

fn main() {
    println!("{:?}", add_prime(2_f64, 0));
}