10 execution_provider: Optional[OnnxRuntimeType] =
None,
11 name=
"OnnxRuntimeSessionTool", **kwargs):
12 """"Configure OnnxRuntimeSessionTool in Control/AthOnnx/AthOnnxComps/src"""
17 execution_provider = flags.AthOnnx.ExecutionProvider
if execution_provider
is None else execution_provider
18 name += execution_provider.name
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))
26 raise ValueError(
"Unknown OnnxRuntime Execution Provider: %s" % execution_provider)