module onnxrt.optim.onnx_optimisation_redundant

Short summary

module mlprodict.onnxrt.optim.onnx_optimisation_redundant

Optimisation of ONNX graphs.

source on GitHub

Functions

function

truncated documentation

_hash_obj_content

Hash the content of an object.

onnx_remove_node_redundant

Removes redundant part of the graph. A redundant part is a set of nodes which takes the same inputs and produces …

Documentation

Optimisation of ONNX graphs.

source on GitHub

mlprodict.onnxrt.optim.onnx_optimisation_redundant._hash_obj_content(obj, max_size=1000)

Hash the content of an object.

source on GitHub

mlprodict.onnxrt.optim.onnx_optimisation_redundant.onnx_remove_node_redundant(onnx_model, recursive=True, debug_info=None, max_hash_size=1000, **options)

Removes redundant part of the graph. A redundant part is a set of nodes which takes the same inputs and produces the same outputs. It first starts by looking into duplicated initializers, then looks into nodes taking the same inputs and sharing the same type and parameters.

Parameters
  • onnx_model – onnx model

  • recursive – looks into subgraphs

  • debug_info – debug information (private)

  • max_hash_size – limit the size of a hash used to detect identical subgraphs

  • options – additional options (unused)

Returns

new onnx _model

source on GitHub