46 modelFile = modelName +
".onnx"
57 input_names=[
"input"],
58 output_names=[
"output"],
62 print(
"calling torch.onnx.export with parameters", kwargs)
66 print(
"model exported to ONNX as", modelFile)
79 print(
"0weight", data)
81 print(
"2weight", data)
91 print(
"Generated model header file ", modelCode)
100modelName =
"LinearModel"
120sofie =
getattr(ROOT,
"TMVA_SOFIE_" + modelName)
124print(
"\n************************************************************")
125print(
"Running inference with SOFIE ")
126print(
"\ninput to model is ", x)
130print(
"-> output using SOFIE = ", y_sofie)
134 import onnxruntime
as ort
137 print(
"Running inference with ONNXRuntime ")
143 print(
"-> output using ORT =", y_ort)
145 testFailed = abs(y_sofie - y_ort) > 0.01
147 raise RuntimeError(
"Result is different between SOFIE and ONNXRT")
152 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.