Abstract class providing interface for various specialized implementations.
More...
#include <FastSimulations.h>
Inherited by o2::zdc::fastsim::ConditionalModelSimulation.
|
| NeuralFastSimulation (const std::string &modelPath, OrtAllocatorType allocatorType, OrtMemType memoryType, int64_t batchSize) |
|
virtual | ~NeuralFastSimulation ()=default |
|
void | initRunSession () |
| (late) init session and provide mechanism to customize ONNX session with external options
|
|
virtual bool | setInput (std::vector< std::vector< float > > &input)=0 |
| Wrapper for converting raw input to Ort::Value.
|
|
virtual void | run ()=0 |
| Wraps Session.Run() Result should be stored as private member.
|
|
virtual const std::vector< Ort::Value > & | getResult ()=0 |
| returns model output as const &.
|
|
size_t | getBatchSize () const |
|
|
void | setInputOutputData () |
| Sets models metadata (input/output layers names, inputs shape) in onnx session.
|
|
void | setTensors (std::vector< std::vector< float > > &input) |
| Converts flattend input data to Ort::Value. Tensor shapes are taken from loaded model metadata.
|
|
Abstract class providing interface for various specialized implementations.
Definition at line 34 of file FastSimulations.h.
◆ NeuralFastSimulation()
NeuralFastSimulation::NeuralFastSimulation |
( |
const std::string & |
modelPath, |
|
|
OrtAllocatorType |
allocatorType, |
|
|
OrtMemType |
memoryType, |
|
|
int64_t |
batchSize |
|
) |
| |
◆ ~NeuralFastSimulation()
virtual o2::zdc::fastsim::NeuralFastSimulation::~NeuralFastSimulation |
( |
| ) |
|
|
virtualdefault |
◆ getBatchSize()
size_t NeuralFastSimulation::getBatchSize |
( |
| ) |
const |
◆ getResult()
virtual const std::vector< Ort::Value > & o2::zdc::fastsim::NeuralFastSimulation::getResult |
( |
| ) |
|
|
pure virtual |
◆ initRunSession()
void NeuralFastSimulation::initRunSession |
( |
| ) |
|
(late) init session and provide mechanism to customize ONNX session with external options
Definition at line 34 of file FastSimulations.cxx.
◆ run()
virtual void o2::zdc::fastsim::NeuralFastSimulation::run |
( |
| ) |
|
|
pure virtual |
◆ setInput()
virtual bool o2::zdc::fastsim::NeuralFastSimulation::setInput |
( |
std::vector< std::vector< float > > & |
input | ) |
|
|
pure virtual |
◆ setInputOutputData()
void NeuralFastSimulation::setInputOutputData |
( |
| ) |
|
|
protected |
Sets models metadata (input/output layers names, inputs shape) in onnx session.
Definition at line 48 of file FastSimulations.cxx.
◆ setTensors()
void NeuralFastSimulation::setTensors |
( |
std::vector< std::vector< float > > & |
input | ) |
|
|
protected |
Converts flattend input data to Ort::Value. Tensor shapes are taken from loaded model metadata.
Definition at line 72 of file FastSimulations.cxx.
◆ mAllocator
Ort::AllocatorWithDefaultOptions o2::zdc::fastsim::NeuralFastSimulation::mAllocator |
|
protected |
◆ mBatchSize
int64_t o2::zdc::fastsim::NeuralFastSimulation::mBatchSize |
|
protected |
If model has dynamic axis (for batch processing) this will tell ONNX expected size of those axis otherwise mBatchSize has no effect during runtime
Definition at line 90 of file FastSimulations.h.
◆ mEnv
Ort::Env o2::zdc::fastsim::NeuralFastSimulation::mEnv |
|
protected |
ONNX specific attributes User shoudn't has direct access to those in derived classes
Definition at line 79 of file FastSimulations.h.
◆ mInputNames
std::vector<std::string> o2::zdc::fastsim::NeuralFastSimulation::mInputNames |
|
protected |
◆ mInputShapes
std::vector<std::vector<int64_t> > o2::zdc::fastsim::NeuralFastSimulation::mInputShapes |
|
protected |
◆ mInputTensors
std::vector<Ort::Value> o2::zdc::fastsim::NeuralFastSimulation::mInputTensors |
|
protected |
◆ mMemoryInfo
Ort::MemoryInfo o2::zdc::fastsim::NeuralFastSimulation::mMemoryInfo |
|
protected |
◆ mModelPath
std::string o2::zdc::fastsim::NeuralFastSimulation::mModelPath |
|
protected |
◆ mOutputNames
std::vector<std::string> o2::zdc::fastsim::NeuralFastSimulation::mOutputNames |
|
protected |
◆ mSession
Ort::Session* o2::zdc::fastsim::NeuralFastSimulation::mSession = nullptr |
|
protected |
The documentation for this class was generated from the following files: