MCPcopy
hub / github.com/OpenPPL/ppq / load_graph

Function load_graph

ppq/api/interface.py:28–37  ·  view source on GitHub ↗
(file_path: str, from_framework: NetworkFramework=NetworkFramework.ONNX, **kwargs)

Source from the content-addressed store, hash-verified

26
27
28def load_graph(file_path: str, from_framework: NetworkFramework=NetworkFramework.ONNX, **kwargs) -> BaseGraph:
29 parser = PFL.Parser(from_framework)
30 assert isinstance(parser, GraphBuilder), 'Unexpected Parser found.'
31 if from_framework == NetworkFramework.CAFFE:
32 assert 'caffemodel_path' in kwargs, ('parameter "caffemodel_path" is required here for loading caffe model from file, '
33 'however it is missing from your invoking.')
34 graph = parser.build(prototxt_path=file_path, caffemodel_path=kwargs['caffemodel_path'])
35 else:
36 graph = parser.build(file_path)
37 return graph
38
39def load_onnx_graph(onnx_import_file: str) -> BaseGraph:
40 """

Callers 4

load_onnx_graphFunction · 0.85
load_caffe_graphFunction · 0.85
load_native_graphFunction · 0.85
quantize_caffe_modelFunction · 0.85

Calls 1

buildMethod · 0.45

Tested by

no test coverage detected