quark.onnx.utils.model_utils#

Module Contents#

Functions#

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.