ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthOnnx
AthOnnxComps
python
OnnxRuntimeInferenceConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
4
from
AthenaConfiguration.ComponentFactory
import
CompFactory
5
from
AthOnnxComps.OnnxRuntimeFlags
import
OnnxRuntimeType
6
from
typing
import
Optional
7
from
AthOnnxComps.OnnxRuntimeSessionConfig
import
OnnxRuntimeSessionToolCfg
8
9
def
OnnxRuntimeInferenceToolCfg
(flags,
10
model_fname: str =
None
,
11
execution_provider: Optional[OnnxRuntimeType] =
None
,
12
name=
"OnnxRuntimeInferenceTool"
, **kwargs):
13
"""Configure OnnxRuntimeInferenceTool in Control/AthOnnx/AthOnnxComps/src"""
14
15
acc = ComponentAccumulator()
16
17
if
"OnnxRuntimeSvc"
not
in
kwargs:
18
from
AthOnnxComps.OnnxRuntimeSvcConfig
import
OnnxRuntimeSvcCfg
19
kwargs.setdefault(
"OnnxRuntimeSvc"
, acc.getPrimaryAndMerge(OnnxRuntimeSvcCfg(flags)))
20
kwargs.setdefault(
"ORTSessionTool"
, acc.popToolsAndMerge(OnnxRuntimeSessionToolCfg(flags, model_fname, execution_provider)))
21
acc.setPrivateTools(CompFactory.AthOnnx.OnnxRuntimeInferenceTool(name, **kwargs))
22
return
acc
python.OnnxRuntimeInferenceConfig.OnnxRuntimeInferenceToolCfg
OnnxRuntimeInferenceToolCfg(flags, str model_fname=None, Optional[OnnxRuntimeType] execution_provider=None, name="OnnxRuntimeInferenceTool", **kwargs)
Definition
OnnxRuntimeInferenceConfig.py:12
Generated on
for ATLAS Offline Software by
1.17.0