quark.onnx.utils.model_utils#

Utility functions.

Module Contents#

Functions#

get_tensor_value(→ numpy.ndarray[Any, ...)

Convert TensorProto to numpy array.

generate_initializer(→ onnx.TensorProto)

Generate initializers from numpy array.

save_model(→ None)

Save onnx model to disk.

quark.onnx.utils.model_utils.get_tensor_value(initializer: onnx.TensorProto) numpy.ndarray[Any, numpy.dtype[numpy.float32]]#

Convert TensorProto to numpy array.

quark.onnx.utils.model_utils.generate_initializer(tensor_array: numpy.ndarray[Any, numpy.dtype[numpy.float32]], dtype: Any, name: str) onnx.TensorProto#

Generate initializers from numpy array.

quark.onnx.utils.model_utils.save_model(model: onnx.ModelProto, path: str, as_text: bool = False) None#

Save onnx model to disk.