Understanding vmap
+ make_rng
#3393
-
I tried to use
I was initially surprised to see that each call to In this case, the fix is simple, just fold in an index:
Is this the best fix, or should I use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
With
Also I think you had a typo in your code, since the variable
In this case, it would fold in the same rng key and you'd only get a different output if the input |
Beta Was this translation helpful? Give feedback.
With
nn.vmap
, you could do something like this:Also I think you had a typo in your code, since the variable
x
isn't defined: