yobx.xbuilder#
API for the graph builder used to construct and optimize ONNX graphs.
GraphBuilder and OptimizationOptions expose the native
onnx-light adapter. The historical yobx.xbuilder.graph_builder and
yobx.xbuilder.optimization_options imports resolve to the same classes.
Graph construction, shape inference and pattern optimization do not fall back
to the former Python engines.
Native optimization options select registered pattern names through
patterns and limit iterations through max_iter.
"default+onnxruntime" remains a compatibility alias for the native default
patterns. Python pattern objects, other legacy pattern groups, and unsupported
legacy options raise explicit errors.
The historical graph_builder_opset.Opset import resolves to the native
adapter too. The Python OrderOptimization engine and OrderAlgorithm
selection have been retired; shape-node ordering uses the native builder’s
move_shape_and_size_nodes operation.
modules
GraphBuilder#
- yobx.xbuilder.GraphBuilder[source]#
alias of
OnnxLightGraphBuilder
FunctionOptions#
- class yobx.xbuilder.FunctionOptions(export_as_function: bool = False, name: str = '', domain: str = '', external_threshold: int = 33554432, move_initializer_to_constant: bool = False, return_initializer: bool = False, inline: bool = False, merge_allowed: bool = False, rename_allowed: bool = False)[source]#
Defines how local functions must behave.
- Parameters:
name – function name
domain – function domain
export_as_function – export the onnx as functions or keep local function
external_threshold – whether or not keep initializer as input for the function or move them as constant of the function
move_initializer_to_constant – move initializers as constant first before creating the function proto, that depends on the size defined by external_threshold
return_initializer – return the remaining initializer and add them as input to the function
inline – inline functions
rename_allowed – allow to rename the function if a duplicate is detected
merge_allowed – allow to merge a function in case the same code is detected
InferShapesOptions#
OptimizationOptions#
- yobx.xbuilder.OptimizationOptions[source]#
alias of
OnnxLightOptimizationOptions
Intermediate Classes#
InitializerInfo#
VirtualTensor#
WrapDim#
WrapSym#
- class yobx.xbuilder._wrap_sym.WrapSym(sym: torch.SymInt | torch.SymFloat | WrapSym)[source]#
Wraps a symbolic int (a dimension for example).
- property name#
Returns the name as a string.