Skip to content

vmapping lambda functions #23774

Answered by jakevdp
aadityacs asked this question in Q&A
Sep 19, 2024 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

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 the lambda function that closes over some arguments.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@aadityacs
Comment options

Comment options

You must be logged in to vote
1 reply
@aadityacs
Comment options

Answer selected by aadityacs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants