mlx.nn.Module.apply_to_modules#

Module.apply_to_modules(apply_fn: Callable[[str, Module], Any]) Module#

Apply a function to all the modules in this instance (including this instance).

Parameters:

apply_fn (Callable) – The function to apply to the modules.

Returns:

The module instance after updating submodules.