54 modelFile = modelName +
".onnx"
67 input_names=[
"input"],
68 output_names=[
"output"],
72 print(
"calling torch.onnx.export with parameters",kwargs)
76 print(
"model exported to ONNX as",modelFile)
79 print(
"Cannot export model from pytorch to ONNX - with version ",
torch.__version__)
80 print(
"Skip tutorial execution")
105 print(
"Generated model header file ",modelCode)
113modelName =
"LinearModel"
134sofie =
getattr(ROOT,
'TMVA_SOFIE_' + modelName)
138print(
"\n************************************************************")
139print(
"Running inference with SOFIE ")
140print(
"\ninput to model is ",x)
144print(
"-> output using SOFIE = ", y_sofie)
148 import onnxruntime
as ort
150 print(
"Running inference with ONNXRuntime ")
156 print(
"-> output using ORT =", y_ort)
158 testFailed = abs(y_sofie-y_ort) > 0.01
160 raiseError(
'Result is different between SOFIE and ONNXRT')
165 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.