onnx.inliner¶
inline_local_functions¶
- onnx.inliner.inline_local_functions(model: ModelProto, convert_version: bool = False) ModelProto [source]¶
内联给定模型中的模型本地函数。
- 参数:
model – 一个 ONNX ModelProto
convert_version – 如果为 true,则尝试对需要与模型不同 (ONNX) opset 版本的函数应用自动版本转换。
- 返回:
ModelProto,其中所有对模型本地函数的调用都已内联(递归)
inline_selected_functions¶
- onnx.inliner.inline_selected_functions(model: ModelProto, function_ids: list[tuple[str, str]], exclude: bool = False) ModelProto [source]¶
内联给定模型中选定的模型本地函数。
- 参数:
model – 一个 ONNX ModelProto
function_ids – 内联时包含/排除的函数列表。每个元素是一个元组 (function domain, function name)。
exclude – 如果为 true,则内联除 function_ids 中指定的函数之外的所有函数。如果为 false,则内联 function_ids 中指定的所有函数。
- 返回:
ModelProto,其中所有对模型本地函数的调用都已内联(递归)