Git Product home page Git Product logo

Comments (5)

OwenTrokeBillard avatar OwenTrokeBillard commented on August 21, 2024 1

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.

from rust.

ZuseZ4 avatar ZuseZ4 commented on August 21, 2024

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.

from rust.

jedbrown avatar jedbrown commented on August 21, 2024

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.

from rust.

jedbrown avatar jedbrown commented on August 21, 2024

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.

from rust.

ZuseZ4 avatar ZuseZ4 commented on August 21, 2024

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.

from rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.