-
Hi, I created a custom wrapper for The wrapper is based on the answer given in #13836, but more general. I hope I'm not missing something here. Do you think such helpers should be avoided in general? Here's the code-block: Decorator
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
That's a nice approach! It does a good job working around what I think is the fundamental issue of |
Beta Was this translation helpful? Give feedback.
-
Thanks @jakevdp for the details! I just wasn't sure if there are any reasons why such a decorator should not be used. I'm going to add JAX as AD-backend in 🔍 FElupe for hyperelastic material formulations. Right now, I'm using a self-written forward-mode AD package |
Beta Was this translation helpful? Give feedback.
That's a nice approach! It does a good job working around what I think is the fundamental issue of
vmap
: that it returns a wrapper that treats positional and keyword arguments differently. The "real" fix would be to modernize thevmap
API (similar to the work a while ago withjit
to handle bothstatic_argnames
andstatic_argnums
in a uniform way), but that's not something anybody has thought deeply about yet I think.