mapping_networks.runtime.clone_module_buffers¶
- mapping_networks.runtime.clone_module_buffers(module: Module) dict[str, Tensor]¶
Clone all target buffers so stateful forwards cannot mutate the target.
BatchNorm and similar modules may update buffers in-place while in training mode. Passing per-call clones preserves their normal within-forward behavior and discards those updates after the call.