peal.architectures.onnx_predictor.load_onnx_predictor¶
- peal.architectures.onnx_predictor.load_onnx_predictor(path, device='cuda')[source]¶
What
get_predictorcalls for a.onnxpath: the trainable module when the conversion succeeds, the runtime closure otherwise.- Parameters:
path (
str) – Path of the.onnxfile.device (
strortorch.device) – Device for the module or the closure’s outputs.
- Returns:
load_onnx_as_torch()result, or theload_onnx_runtime()closure whenPEAL_ONNX_CONVERT=0or the conversion raisedImportError/RuntimeError(a warning names the reason).- Return type:
OnnxPredictororcallable