.. _f-onnxtranslator: module ``onnx_grammar.onnx_translator`` ======================================= .. inheritance-diagram:: mlprodict.onnx_grammar.onnx_translator Short summary +++++++++++++ module ``mlprodict.onnx_grammar.onnx_translator`` One class which visits a syntax tree. :githublink:`%|py|5` Classes +++++++ +---------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | class | truncated documentation | +=================================================================================+============================================================================================================================+ | :class:`CodeTranslator ` | Class which converts a Python function into something else. It must implements methods *visit* and *depart*. | +---------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | :class:`OnnxTranslator ` | Class which converts a Python function into an :epkg:`ONNX` function. It must implements methods *visit* and *depart*. ... | +---------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ Methods +++++++ +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | method | truncated documentation | +============================================================================================================+==================================================================================+ | :py:meth:`__init__ ` | | +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`_fix_default_values ` | Maps default values with parameter names. | +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`_get_last ` | | +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`_is_stacked ` | | +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`_post_process ` | Simplifies some operator such as ``OnnxNeg(2)``. | +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`depart ` | Leaves a node. | +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`depart ` | Visits a node. | +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`export ` | Exports the parsed :epkg:`python` code into something. | +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`export ` | Returns an :epkg:`ONNX` graph or a piece of code which could generate the graph. | +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`make_msg ` | Make a message with line and column information. | +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`visit ` | Visits a node. | +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`visit ` | Visits a node. | +------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: mlprodict.onnx_grammar.onnx_translator :members: :special-members: __init__ :show-inheritance: