keras/src/models/variable_mapping.py/map_container_variables
def map_container_variables(container, store, visited_saveables):
    if isinstance(container, dict):
        container = list(container.values())

    for saveable in container:
        if isinstance(saveable, KerasSaveable):
            map_saveable_variables(
                saveable,
                store,
                visited_saveables=visited_saveables,
            )