|
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
|
Replies: 2 comments
|
That's a nice approach! It does a good job working around what I think is the fundamental issue of |
|
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 |
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 thevmapAPI (similar to the work a while ago withjitto handle bothstatic_argnamesandstatic_argnumsin a uniform way), but that's not something anybody has thought deeply about yet I think.