modeci_mdf.functions.onnx.run_onnx_op

modeci_mdf.functions.onnx.run_onnx_op(op_name: str, inputs: Dict[str, array], output_names: List[str], opset_version: int = 15, **attributes)[source]

Simple helper function that invokes a single ONNX operator with inputs and attibutes and returns the results. This isn’t typically done in ONNX because graphs usually consist of more than one operation. This wrapper probably creates a significant amount of overhead for but if we want to execute and ONNX graph op by op it is the easiest thing to do.

Parameters:
  • op_name – The name of the operation to run, (Conv, Pad, etc.)

  • inputs – A dict keyed by input name where the values are the input values to pass to the operation.

  • output_names – The names to use for the output values.

  • **attributes – Any additional attributes for the ONNX operation.

Returns:

A dict of output values, keys are output_names. Values are the output values of the operation.