compose.utils#
- batch_apply_fn(_apply_fn)[source]#
Combine vmapped graphs into disconnected supergraphs.
A mapped parameter leaf cannot be shared by one supergraph evaluation. In that case the affected map level is evaluated sequentially, so a model primitive is never asked to accept a parameter batch dimension.
The returned function supports arbitrary nesting of
vmapand reverse-mode differentiation. JAX does not support forward-mode differentiation ofcustom_vjpfunctions, so applyingjax.jvpto this wrapper raisesTypeError.- Return type: