56 modelFile = modelName +
".onnx"
69 input_names=[
"input"],
70 output_names=[
"output"],
74 print(
"calling torch.onnx.export with parameters",kwargs)
78 print(
"model exported to ONNX as",modelFile)
81 print(
"Cannot export model from pytorch to ONNX - with version ",
torch.__version__)
82 print(
"Skip tutorial execution")
107 print(
"Generated model header file ",modelCode)
115modelName =
"LinearModel"
136sofie =
getattr(ROOT,
'TMVA_SOFIE_' + modelName)
140print(
"\n************************************************************")
141print(
"Running inference with SOFIE ")
142print(
"\ninput to model is ",x)
146print(
"-> output using SOFIE = ", y_sofie)
150 import onnxruntime
as ort
152 print(
"Running inference with ONNXRuntime ")
158 print(
"-> output using ORT =", y_ort)
160 testFailed = abs(y_sofie-y_ort) > 0.01
162 raiseError(
'Result is different between SOFIE and ONNXRT')
167 print(
"Missing ONNXRuntime: skipping comparison test")
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.