Analysis Software
Documentation for sPHENIX simulation software
|
#include <acts/blob/sPHENIX/Plugins/Onnx/include/Acts/Plugins/Onnx/OnnxRuntimeBase.hpp>
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 |
Definition at line 22 of file OnnxRuntimeBase.hpp.
View newest version in sPHENIX GitHub at line 22 of file OnnxRuntimeBase.hpp
|
default |
Default constructor.
Acts::OnnxRuntimeBase::OnnxRuntimeBase | ( | Ort::Env & | env, |
const char * | modelPath | ||
) |
Parametrized constructor.
env | the ONNX runtime environment |
modelPath | the 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.
|
default |
Default destructor.
std::vector< float > Acts::OnnxRuntimeBase::runONNXInference | ( | std::vector< float > & | inputTensorValues | ) | const |
Run the ONNX inference function.
inputTensorValues | The input feature values used for prediction |
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().
std::vector< std::vector< float > > Acts::OnnxRuntimeBase::runONNXInference | ( | Acts::NetworkBatchInput & | inputTensorValues | ) | const |
Run the ONNX inference function for a batch of input.
inputTensorValues | Vector of the input feature values of all the inputs used for prediction |
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.
inputTensorValues | Vector of the input feature values of all the inputs used for prediction |
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().