ATLAS Offline Software
Functions
python.OnnxRuntimeSessionConfig Namespace Reference

Functions

def OnnxRuntimeSessionToolCfg (flags, str model_fname, Optional[OnnxRuntimeType] execution_provider=None, name="OnnxRuntimeSessionTool", **kwargs)
 

Function Documentation

◆ OnnxRuntimeSessionToolCfg()

def python.OnnxRuntimeSessionConfig.OnnxRuntimeSessionToolCfg (   flags,
str  model_fname,
Optional[OnnxRuntimeType]   execution_provider = None,
  name = "OnnxRuntimeSessionTool",
**  kwargs 
)
"Configure OnnxRuntimeSessionTool in Control/AthOnnx/AthOnnxComps/src

Definition at line 8 of file OnnxRuntimeSessionConfig.py.

9  model_fname: str,
10  execution_provider: Optional[OnnxRuntimeType] = None,
11  name="OnnxRuntimeSessionTool", **kwargs):
12  """"Configure OnnxRuntimeSessionTool in Control/AthOnnx/AthOnnxComps/src"""
13 
14  acc = ComponentAccumulator()
15 
16 
17  execution_provider = flags.AthOnnx.ExecutionProvider if execution_provider is None else execution_provider
18  name += execution_provider.name
19 
20  kwargs.setdefault("ModelFileName", model_fname)
21  if execution_provider is OnnxRuntimeType.CPU:
22  acc.setPrivateTools(CompFactory.AthOnnx.OnnxRuntimeSessionToolCPU(name, **kwargs))
23  elif execution_provider is OnnxRuntimeType.CUDA:
24  acc.setPrivateTools(CompFactory.AthOnnx.OnnxRuntimeSessionToolCUDA(name, **kwargs))
25  else:
26  raise ValueError("Unknown OnnxRuntime Execution Provider: %s" % execution_provider)
27 
28  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.OnnxRuntimeSessionConfig.OnnxRuntimeSessionToolCfg
def OnnxRuntimeSessionToolCfg(flags, str model_fname, Optional[OnnxRuntimeType] execution_provider=None, name="OnnxRuntimeSessionTool", **kwargs)
Definition: OnnxRuntimeSessionConfig.py:8