Heuristic:Onnx Onnx Warning Deprecated InlineSelectedFunctions
| Knowledge Sources | |
|---|---|
| Domains | Function_Inlining, API_Deprecation |
| Last Updated | 2026-02-10 00:00 GMT |
Overview
Deprecation warning: the two-parameter overload of InlineSelectedFunctions is deprecated in favor of InlineSelectedLocalFunctions.
Description
The two-parameter overload of InlineSelectedFunctions(ModelProto&, const FunctionIdSet&) in onnx/inliner/inliner.h is marked with @deprecated in the source code. It was retained for backward compatibility but should not be used in new code. The deprecation exists to avoid confusion with the three-parameter overload of InlineSelectedFunctions that inlines schema-defined functions as well.
Usage
Apply this warning when reviewing or writing code that calls InlineSelectedFunctions with only two parameters (model and function id set). Replace such calls with InlineSelectedLocalFunctions, which has identical behavior but a clearer name.
The Insight (Rule of Thumb)
- Action: Replace all calls to the two-parameter InlineSelectedFunctions(model, to_inline) with InlineSelectedLocalFunctions(model, to_inline).
- Value: Direct function rename; no parameter changes needed.
- Trade-off: None. The functions are functionally identical.
Reasoning
The ONNX team deprecated the two-parameter overload because having two overloads of InlineSelectedFunctions with different semantics (one for model-local functions, one for schema-defined functions) was confusing. The rename to InlineSelectedLocalFunctions makes the scope of inlining explicit in the function name.