Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::OnnxRuntimeBase Class Reference

#include <acts/blob/sPHENIX/Plugins/Onnx/include/Acts/Plugins/Onnx/OnnxRuntimeBase.hpp>

+ Inheritance diagram for Acts::OnnxRuntimeBase:
+ Collaboration diagram for Acts::OnnxRuntimeBase:

Public Member Functions

 OnnxRuntimeBase ()=default
 Default constructor.
 
 OnnxRuntimeBase (Ort::Env &env, const char *modelPath)
 Parametrized constructor.
 
 ~OnnxRuntimeBase ()=default
 Default destructor.
 
std::vector< float > runONNXInference (std::vector< float > &inputTensorValues) const
 Run the ONNX inference function.
 
std::vector< std::vector< float > > runONNXInference (NetworkBatchInput &inputTensorValues) const
 Run the ONNX inference function for a batch of input.
 
std::vector< std::vector
< std::vector< float > > > 
runONNXInferenceMultiOutput (NetworkBatchInput &inputTensorValues) const
 Run the multi-output ONNX inference function for a batch of input.
 

Private Attributes

std::unique_ptr< Ort::Session > m_session
 ONNX runtime session / model properties.
 
std::vector
< Ort::AllocatedStringPtr > 
m_inputNodeNamesAllocated
 
std::vector< const char * > m_inputNodeNames
 
std::vector< int64_t > m_inputNodeDims
 
std::vector
< Ort::AllocatedStringPtr > 
m_outputNodeNamesAllocated
 
std::vector< const char * > m_outputNodeNames
 
std::vector< std::vector
< int64_t > > 
m_outputNodeDims
 

Detailed Description

Definition at line 22 of file OnnxRuntimeBase.hpp.

View newest version in sPHENIX GitHub at line 22 of file OnnxRuntimeBase.hpp

Constructor & Destructor Documentation

Acts::OnnxRuntimeBase::OnnxRuntimeBase ( )
default

Default constructor.

Acts::OnnxRuntimeBase::OnnxRuntimeBase ( Ort::Env &  env,
const char *  modelPath 
)

Parametrized constructor.

Parameters
envthe ONNX runtime environment
modelPaththe path to the ML model in *.onnx format

Definition at line 15 of file OnnxRuntimeBase.cpp.

View newest version in sPHENIX GitHub at line 15 of file OnnxRuntimeBase.cpp

References conf::env, i, m_inputNodeDims, m_inputNodeNames, m_inputNodeNamesAllocated, m_outputNodeDims, m_outputNodeNames, m_outputNodeNamesAllocated, and m_session.

Acts::OnnxRuntimeBase::~OnnxRuntimeBase ( )
default

Default destructor.

Member Function Documentation

std::vector< float > Acts::OnnxRuntimeBase::runONNXInference ( std::vector< float > &  inputTensorValues) const

Run the ONNX inference function.

Parameters
inputTensorValuesThe input feature values used for prediction
Returns
The output (predicted) values

Definition at line 57 of file OnnxRuntimeBase.cpp.

View newest version in sPHENIX GitHub at line 57 of file OnnxRuntimeBase.cpp

References i.

Referenced by Acts::AmbiguityTrackClassifier::inferScores(), and Acts::MLTrackClassifier::predictTrackLabel().

+ Here is the caller graph for this function:

std::vector< std::vector< float > > Acts::OnnxRuntimeBase::runONNXInference ( Acts::NetworkBatchInput inputTensorValues) const

Run the ONNX inference function for a batch of input.

Parameters
inputTensorValuesVector of the input feature values of all the inputs used for prediction
Returns
The vector of output (predicted) values

Definition at line 69 of file OnnxRuntimeBase.cpp.

View newest version in sPHENIX GitHub at line 69 of file OnnxRuntimeBase.cpp

std::vector< std::vector< std::vector< float > > > Acts::OnnxRuntimeBase::runONNXInferenceMultiOutput ( NetworkBatchInput inputTensorValues) const

Run the multi-output ONNX inference function for a batch of input.

Parameters
inputTensorValuesVector of the input feature values of all the inputs used for prediction
Returns
The vector of output (predicted) values, one for each output

Definition at line 76 of file OnnxRuntimeBase.cpp.

View newest version in sPHENIX GitHub at line 76 of file OnnxRuntimeBase.cpp

References i, j, testing::internal::move(), and testing::Value().

+ Here is the call graph for this function:

Member Data Documentation

std::vector<int64_t> Acts::OnnxRuntimeBase::m_inputNodeDims
private

Definition at line 65 of file OnnxRuntimeBase.hpp.

View newest version in sPHENIX GitHub at line 65 of file OnnxRuntimeBase.hpp

Referenced by OnnxRuntimeBase().

std::vector<const char*> Acts::OnnxRuntimeBase::m_inputNodeNames
private

Definition at line 64 of file OnnxRuntimeBase.hpp.

View newest version in sPHENIX GitHub at line 64 of file OnnxRuntimeBase.hpp

Referenced by OnnxRuntimeBase().

std::vector<Ort::AllocatedStringPtr> Acts::OnnxRuntimeBase::m_inputNodeNamesAllocated
private

Definition at line 63 of file OnnxRuntimeBase.hpp.

View newest version in sPHENIX GitHub at line 63 of file OnnxRuntimeBase.hpp

Referenced by OnnxRuntimeBase().

std::vector<std::vector<int64_t> > Acts::OnnxRuntimeBase::m_outputNodeDims
private

Definition at line 68 of file OnnxRuntimeBase.hpp.

View newest version in sPHENIX GitHub at line 68 of file OnnxRuntimeBase.hpp

Referenced by OnnxRuntimeBase().

std::vector<const char*> Acts::OnnxRuntimeBase::m_outputNodeNames
private

Definition at line 67 of file OnnxRuntimeBase.hpp.

View newest version in sPHENIX GitHub at line 67 of file OnnxRuntimeBase.hpp

Referenced by OnnxRuntimeBase().

std::vector<Ort::AllocatedStringPtr> Acts::OnnxRuntimeBase::m_outputNodeNamesAllocated
private

Definition at line 66 of file OnnxRuntimeBase.hpp.

View newest version in sPHENIX GitHub at line 66 of file OnnxRuntimeBase.hpp

Referenced by OnnxRuntimeBase().

std::unique_ptr<Ort::Session> Acts::OnnxRuntimeBase::m_session
private

ONNX runtime session / model properties.

Definition at line 62 of file OnnxRuntimeBase.hpp.

View newest version in sPHENIX GitHub at line 62 of file OnnxRuntimeBase.hpp

Referenced by OnnxRuntimeBase().


The documentation for this class was generated from the following files: