pub fn parallel_step<O, A, D>(
optimizer: &mut O,
params_list: &[Array<A, D>],
grads_list: &[Array<A, D>],
) -> Result<Vec<Array<A, D>>>Expand description
Helper function to update several parameter groups with a single optimizer
This is a convenience function for one-off multi-group processing without
creating a ParallelOptimizer instance.
The update is delegated to Optimizer::step_list, which keeps an independent
state slot per parameter-group index. Consequently the optimizer state is
preserved across calls and groups never share moments.
§Note on parallelism
A single &mut O cannot be mutated from several threads at once, so this helper
walks the groups sequentially. Use ParallelOptimizer::step_parallel_groups
when you want the groups themselves processed in parallel: it keeps one
optimizer instance per group and therefore both parallelizes and preserves
state.
§Arguments
optimizer- The optimizer to use (its per-index state is updated in place)params_list- List of parameter arraysgrads_list- List of gradient arrays
§Returns
Updated parameter arrays