def _get_module_level_advanced_options(
        module: _nn.Module, module_level_config: _ModuleDKMPalettizerConfig
    ) -> _ParamsDict:
        """
        Returns advanced_options for a module. First checks whether the user specified something for
        those options in the palettization_config. If not, uses the options from the
        DEFAULT_PALETTIZATION_SCHEME of that module type.
        """
        module_level_advanced_options = {}
        for key in _DEFAULT_PALETTIZATION_ADVANCED_OPTIONS.keys():
            if (
                key == "cluster_permute"
                and module_level_config.cluster_dtype == "oc_last"
                and hasattr(module, "weight")
            ):
                cluster_permute = list(range(module.weight.dim()))
                cluster_permute = cluster_permute[1:] + cluster_permute[:1]
                module_level_advanced_options[key] = cluster_permute
            else:
                module_level_advanced_options[key] = getattr(module_level_config, key)
        return module_level_advanced_options

        Returns advanced_options for a module. First checks whether the user specified something for
        those options in the palettization_config. If not, uses the options from the
        DEFAULT_PALETTIZATION_SCHEME of that module type.
        
coremltools/optimize/torch/palettization/palettizer.py