def fix_dim_params(model_proto: onnx.ModelProto, dim_params: list[str], dim_values: list[int]):
    """Fix the dimension parameters in the model.

    :param dim_params: The dimension parameters to fix.
    :param dim_values: The values to set for the dimension parameters.
    """
    from onnxruntime.tools.onnx_model_utils import make_dim_param_fixed

    assert len(dim_params) == len(dim_values), "dim_params and dim_values must have the same number of elements."
    assert all(i >= 0 for i in dim_values), "dim_values must be all >= 0"

    for param, value in zip(dim_params, dim_values):
        make_dim_param_fixed(model_proto.graph, param, value)

    # update the output shapes to make them fixed
    _fix_output_shapes(model_proto)
Fix the dimension parameters in the model.

    :param dim_params: The dimension parameters to fix.
    :param dim_values: The values to set for the dimension parameters.
    
olive/passes/onnx/common.py