-
I was wondering how to vmap functions of functions. Lets suppose I have a simple function
Then
with
returns as expected
Now instead lets define a lambda
Then,
returns
Could someone kindly let me know how to get the same result for both? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Your lambda function, |
Beta Was this translation helpful? Give feedback.
-
I think the larger question here is "is it possible to |
Beta Was this translation helpful? Give feedback.
I think the larger question here is "is it possible to
vmap
closed-over variables in a function". The answer to that is no: semantically,vmap
may only map over explicit function arguments. With that in mind, there's no way to get your first output (which maps the function across all arguments) using thelambda
function that closes over some arguments.