def _canonicalize_materialization_map(
        source_function: Function,
        function_name_to_materialization_map: Dict[str, Dict[str, Tuple[int]]],
    ) -> Dict[str, Dict[str, int]]:
        """
        User input ``materialization_map`` maps input names to fixed shapes,
        but what a rigorous graph pass really need is a map from symbols to integers,
        so here we construct the canonical materialization map from user input
        """
        function_name_to_canonical_materialization_map: Dict[str, Dict[str, int]] = {}
        for function_name, materialization_map in function_name_to_materialization_map.items():
            canonical_materialization_map: Dict[str, int] = {}
            for source_input_var in source_function.inputs.values():
                input_name: str = source_input_var.name
                if input_name in materialization_map:
                    fixed_shape = materialization_map[input_name]
                    for size, integer in zip(source_input_var.shape, fixed_shape):
                        if is_symbolic(size):
                            if size.name not in canonical_materialization_map:
                                canonical_materialization_map[size.name] = integer
                            else:
                                existing_integer = canonical_materialization_map[size.name]
                                if existing_integer != integer:
                                    raise ValueError(
                                        f"Inconsistent symbol materialization in new function {function_name}: "
                                        f"symbol {size.name} is to be materialized into {existing_integer} and {integer}. "
                                        f"Please make sure input {input_name} has compatible shape with others"
                                    )
                        else:
                            if size != integer:
                                raise ValueError(
                                    f"Already fixed size cannot be altered: new function {function_name}, "
                                    f"input {input_name}, original size is {size}, but user specified new size {integer}"
                                )
                else:
                    logger.warning(
                        f"In new function {function_name}, "
                        f"although materialization for input {input_name} is not specified, "
                        f"it may still be materialized if it shares symbol with other inputs"
                    )
            function_name_to_canonical_materialization_map[
                function_name
            ] = canonical_materialization_map
        return function_name_to_canonical_materialization_map

        User input ``materialization_map`` maps input names to fixed shapes,
        but what a rigorous graph pass really need is a map from symbols to integers,
        so here we construct the canonical materialization map from user input
        
coremltools/converters/mil/mil/passes/defs/symbol_transform.py