Converter¶

class onnxscript.converter.Converter(ir_builder: IRBuilder | None = None, opset: Opset | None = None, global_names: dict[str, Any] | None = None, source: str | None = None, default_opset: Opset | None = None)[source]¶

Main class to translate python code into ONNX operators.

Parameters:

ir_builder – convert AST node into ONNX structures, if None, class onnxscript.irbuilder.IRBuilder is used

The class uses logger onnxscript. Logging can be enabled with the following code:

import logging
logging.basicConfig(level=logging.DEBUG)

Or if you need to enable only the logger used by this module:

import logging
logger = logging.getLogger('onnxscript')
logger.setLevel(logging.DEBUG)
console = logging.StreamHandler()
logger.addHandler(console)
translate_function_signature(fn: FunctionDef) IRFunction[source]¶

Translate a (top-level) function signature.