def fix_input_shapes(model_proto: onnx.ModelProto, input_names: list[str], input_shapes: list[list[int]]):
    """Fix the input shapes in the model.

    :param input_names: The input names to fix.
    :param input_shapes: The shapes to set for the inputs.
    """
    from onnxruntime.tools.onnx_model_utils import make_input_shape_fixed

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

    for name, shape in zip(input_names, input_shapes):
        make_input_shape_fixed(model_proto.graph, name, shape)

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

    :param input_names: The input names to fix.
    :param input_shapes: The shapes to set for the inputs.
    
olive/passes/onnx/common.py