You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using Haiku (amazing tool, btw!) for about 8 months now. Up until now, I used to wrap my custom haiku modules around hk.transform. Inside my module, I vmapped a function (using hk.vmap) that contained a hk.switch statement (to evaluate a chosen branch function).
I recently moved to using stateful modules, which needs the hk.transform_with_state transform. I also need to keep track of a specific value over time in my machine learning model that is not to be updated by the optimizer. For this, I am using hk.set_state("name", val) to store it and access it later. However, as soon as I use any kind of set_state call anywhere in the model, the vmapped function fails with the error
ValueError: vmap has mapped output but out_axes is None
Is there any way to use hk.switch inside a hk.vmap function when hk.set_state is used in the module?
Thank you.
The text was updated successfully, but these errors were encountered:
Hi,
I have been using Haiku (amazing tool, btw!) for about 8 months now. Up until now, I used to wrap my custom haiku modules around
hk.transform
. Inside my module, I vmapped a function (usinghk.vmap
) that contained ahk.switch
statement (to evaluate a chosen branch function).I recently moved to using stateful modules, which needs the
hk.transform_with_state
transform. I also need to keep track of a specific value over time in my machine learning model that is not to be updated by the optimizer. For this, I am usinghk.set_state("name", val)
to store it and access it later. However, as soon as I use any kind ofset_state
call anywhere in the model, the vmapped function fails with the errorIs there any way to use
hk.switch
inside ahk.vmap
function whenhk.set_state
is used in the module?Thank you.
The text was updated successfully, but these errors were encountered: