yobx.sklearn.skl2onnx_converter#
- class yobx.sklearn.skl2onnx_converter.MockContainer(g: GraphBuilderExtendedProtocol)[source]#
Minimal mock for skl2onnx’s
ModelComponentContainer.Instead of accumulating nodes and initializers, this class delegates every
add_node()/add_initializer()call directly to theGraphBuilder(g) that was provided at construction time.- add_initializer(name: str, onnx_type: int, shape: Tuple[int, ...], content: Any) None[source]#
Forward content directly to the GraphBuilder as a new initializer.
- class yobx.sklearn.skl2onnx_converter.MockOperator(raw_operator, inputs: List[MockVariable], outputs: List[MockVariable])[source]#
Minimal mock for skl2onnx’s
Operator.Holds the fitted sklearn estimator and the input / output
MockVariableobjects so a skl2onnx converter can read tensor names viaoperator.inputs[i].onnx_nameandoperator.output_full_names.
- class yobx.sklearn.skl2onnx_converter.MockScope(g: GraphBuilderExtendedProtocol)[source]#
Minimal mock for skl2onnx’s
Scope.Provides
get_unique_variable_name(), the only method called by typical skl2onnx converter functions. Name uniqueness is guaranteed by delegating to theGraphBuilderinstance (g).