concrete.ml.onnx.onnx_utilsUtils to interpret an ONNX model with numpy.
ATTR_TYPES
ATTR_GETTERS
ONNX_OPS_TO_NUMPY_IMPL
ONNX_COMPARISON_OPS_TO_NUMPY_IMPL_FLOAT
get_attributeGet the attribute from an ONNX AttributeProto.
Args:
attribute (onnx.AttributeProto): The attribute to retrieve the value from.
Returns:
Any: The stored attribute value.
get_op_typeConstruct the qualified type name of the ONNX operator.
Args:
node (Any): ONNX graph node
Returns:
result (str): qualified name
execute_onnx_with_numpyExecute the provided ONNX graph on the given inputs.
Args:
graph (onnx.GraphProto): The ONNX graph to execute.
*inputs: The inputs of the graph.
Returns:
Tuple[numpy.ndarray]: The result of the graph's execution.
remove_initializer_from_inputRemove initializers from model inputs.
In some cases, ONNX initializers may appear, erroneously, as graph inputs. This function searches all model inputs and removes those that are initializers.
Args:
model (onnx.ModelProto): the model to clean
Returns:
onnx.ModelProto: the cleaned model
ONNX_COMPARISON_OPS_TO_NUMPY_IMPL_BOOL
ONNX_OPS_TO_NUMPY_IMPL_BOOL
IMPLEMENTED_ONNX_OPS
get_attribute(attribute: AttributeProto) → Anyget_op_type(node)execute_onnx_with_numpy(graph: GraphProto, *inputs: ndarray) → Tuple[ndarray, ]remove_initializer_from_input(model: ModelProto)