modeci_mdf.interfaces.onnx.importer.onnx_to_mdf

modeci_mdf.interfaces.onnx.importer.onnx_to_mdf(onnx_model: Union[ModelProto, GraphProto], onnx_initializer: Optional[Dict[str, Dict[str, Any]]] = None)[source]

Convert a loaded ONNX model into a MDF model.

Parameters:
  • onnx_model – The ONNX model to convert. Typically, this is the result of a call to onnx.load()

  • onnx_initializer – A specification of values in the graph that ONNX has marked as initializer’s. This dict is keyed on the name of the parameter, the value is another dict with three entries; shape, type, and value.

Returns:

An MDF description of the ONNX model.