yobx.translate#
modules
Top-level helpers#
- yobx.translate.translate(proto: ModelProto, single_line: bool = False, api: str = 'onnx') str[source]#
Translates an ONNX proto into Python code that recreates the ONNX graph.
- Parameters:
proto – model to translate
single_line – as a single line or not
api – API to export into, default is
"onnx"which generates code usingonnx.helper(handled byInnerEmitter),"onnx-short"replaces large initializers with random values (handled byInnerEmitterShortInitializer),"onnx-compact"generates a compact single-expression form (handled byInnerEmitterCompact),"light"generates code for the light API,"builder"generates code for the GraphBuilder,"mermaid"generates a Mermaid flowchart string (handled byMermaidEmitter)
- Returns:
code as a string