Closed ZuseZ4 closed 8 months ago
As per zulip discussion we will remove the Return activity in cases where a function returns (), since we anyhow only accept const there and it might confuse users to have to annotate a not existing return.
I peeked at the unreleased Rust Enzyme book and took notice of the macro syntax.
The current syntax is:
#[autodiff(df, Reverse, Active, Active, Active)]
fn f(x: f32, y: f32) -> f32 {
x * x + 3.0 * y
}
Have you considered putting the activity declarations next to the arguments? That way it is clear which declarations are associated with which arguments. Something like:
#[autodiff(df, Reverse, Active)]
fn f(#[active] x: f32, #[active] y: f32) -> f32 {
x * x + 3.0 * y
}
On another note, the book looks great so far. Excellent work as usual.
That is in fact supported and I prefer it. I believe for technical reasons, we can't/don't support those inline attributes on the return type.
And a word of warning, there are a few syntax bugs in the book currently. I'll fix them (using mdbook test
) as soon as the new rebase is ready.
I am mostly without internet till end of year, I'll answer in more details in the first days of January. The inline syntax is supported, unless you apply multiple autodiff macros to the same function.
Let's collect some opinions on our current macro design to see if there is some common design that people would rather use than our current options:
1) It's fine that we disagree, but to summarize my point (which may well be misguided):