def parse_step_params(model: onnx.ModelProto, step_config: dict):
    """Parse the step parameters for a single step."""
    step_params = step_config.get("params")
    if step_params is None:
        step_params = step_config

    params = {}
    for param_name, param_value in step_params.items():
        # print(param_name, param_value)
        if isinstance(param_value, list):
            resolved_params = []
            for p_v in param_value:
                if isinstance(p_v, dict):
                    resolved_params.append(resolve_placeholder(model, p_v))
                else:
                    resolved_params.append(p_v)
            params[param_name] = tuple(resolved_params)
        elif isinstance(param_value, dict):
            param_type = param_value.get("type")
            param_args = param_value.get("params")
            if param_type and param_args:
                # Customized type definition
                param_cls = get_customized_class(param_type)
                params[param_name] = param_cls(**param_args)
            elif param_type in ("tuple", "list"):
                param_value = param_value.get("value")  # noqa: PLW2901

                # explicitly list or tuple type is specified
                assert isinstance(param_value, list)

                resolved_params = []
                for p_v in param_value:
                    if isinstance(p_v, dict):
                        # handle placeholder
                        resolved_params.append(resolve_placeholder(model, p_v))
                    else:
                        resolved_params.append(p_v)

                if param_type == "tuple":
                    params[param_name] = tuple(resolved_params)
                else:
                    params[param_name] = list(resolved_params)
            elif param_type in ("__model_input__", "__model_output__"):
                params[param_name] = resolve_placeholder(model, param_value)
        else:
            params[param_name] = param_value

    io_map = step_config.get("io_map")
    if io_map:
        assert isinstance(io_map, list)
        params = (params, io_map)

    return params
Parse the step parameters for a single step.
olive/passes/onnx/pipeline/step_utils.py