module onnx_tools.optim.graph_schema_helper#

Short summary#

module mlprodict.onnx_tools.optim.graph_schema_helper

Functions to help guessing the final graph structure.

source on GitHub

Functions#

function

truncated documentation

_guess_type

get_defined_inputs

Retrieves defined inputs in already declared variables bsed on their names.

get_defined_outputs

Gets types of predefined outputs when they cannot be inferred. Some part of it should be automated based on type …

proto2vars

Converts proto values to Variables.

Documentation#

Functions to help guessing the final graph structure.

source on GitHub

mlprodict.onnx_tools.optim.graph_schema_helper._guess_type(var)#
mlprodict.onnx_tools.optim.graph_schema_helper.get_defined_inputs(input_names, variables=None, dtype=None, schema=None)#

Retrieves defined inputs in already declared variables bsed on their names.

Parameters:
  • input_names – input names

  • variables – registered variables created by previous operators

  • dtype – float computational type

  • schema – defined inputs by schema (expected_inputs)

Returns:

typed inputs as tuple(name, type)

source on GitHub

mlprodict.onnx_tools.optim.graph_schema_helper.get_defined_outputs(outputs, onnx_node, typed_inputs=None, variables=None, dtype=None, schema=None, schema_inputs=None)#

Gets types of predefined outputs when they cannot be inferred. Some part of it should be automated based on type constraints.

Parameters:
  • outputs – requested outputs

  • onnx_nodeONNX node definition

  • typed_inputs – known typed inputs of the node as tuple(name, type)

  • variables – registered variables created by previous operators

  • dtype – float computational type

  • schema – defined outputs by schema (expected_outputs)

  • schema_inputs – defined inputs by schema (expected_inputs)

Returns:

typed outputs as tuple(name, type)

source on GitHub

mlprodict.onnx_tools.optim.graph_schema_helper.proto2vars(values)#

Converts proto values to Variables.

source on GitHub