Definition at line 12 of file RModel.hxx.
Public Member Functions | |
RModel ()=default | |
Default constructor. | |
RModel (const RModel &other)=delete | |
RModel (RModel &&other) | |
RModel (std::string function_name) | |
RModel (std::string name, std::string parsedtime) | |
~RModel ()=default | |
template<class T > | |
void | AddConstantTensor (const std::string &name, const std::vector< size_t > &shape, const std::vector< T > &data) |
template<class T > | |
void | AddConstantTensor (const std::string &name, const std::vector< size_t > &shape, const T *data) |
void | AddConstantTensor (std::string tensor_name, ETensorType type, std::vector< std::size_t > shape, std::shared_ptr< void > data) |
void | AddDynamicTensor (std::string tensor_name, ETensorType type, std::vector< Dim > shape) |
template<typename T > | |
void | AddInitializedTensor (const std::string &tensor_name, const std::vector< std::size_t > &shape, T *raw_data) |
void | AddInitializedTensor (std::string tensor_name, ETensorType type, std::vector< std::size_t > shape, std::shared_ptr< void > data) |
void | AddInputTensorInfo (std::string input_name, ETensorType type, std::vector< Dim > shape) |
void | AddInputTensorInfo (std::string input_name, ETensorType type, std::vector< size_t > shape) |
void | AddInputTensorName (std::string name) |
void | AddIntermediateTensor (std::string tensor_name, ETensorType type, std::vector< Dim > dim_shape) |
void | AddIntermediateTensor (std::string tensor_name, ETensorType type, std::vector< std::size_t > shape) |
void | AddOperator (std::unique_ptr< ROperator > op, int order_execution=-1) |
void | AddOperatorReference (ROperator *op, int order_execution=-1) |
void | AddOutputTensorNameList (std::vector< std::string > output_tensor_names) |
std::string | AllocateIntermediateMemory (std::span< const std::string_view > op_output_tensors) |
void | CheckAndFlushIntermediateMemory (std::span< const std::string_view > op_output_tensors, const size_t &op_idx) |
bool | CheckIfTensorAlreadyExist (std::string tensor_name) |
ClassDefNV (RModel, 3) | |
void | Generate (Options options=Options::kDefault, int batchSize=-1, int pos=0, bool verbose=false) |
void | Generate (std::underlying_type_t< Options > options, int batchSize=-1, long pos=0, bool verbose=false) |
std::string | GenerateInferSignature (bool isdecl=true) |
std::vector< Dim > | GetDynamicTensorShape (std::string name) |
std::shared_ptr< void > | GetInitializedTensorData (std::string tensor_name) |
const std::vector< std::string > & | GetInputTensorNames () const |
std::vector< std::string > | GetOutputTensorNames () |
const std::vector< std::string > & | GetOutputTensorNames () const |
const std::vector< size_t > & | GetTensorShape (std::string name) |
const ETensorType & | GetTensorType (std::string name) |
void | HeadInitializedTensors (std::string name, int n_print=50) |
void | Initialize (const std::map< std::string, size_t > &inputParams, bool verbose=false) |
void | Initialize (int batchSize=-1, bool verbose=false) |
void | InitializeSubGraph (std::shared_ptr< RModel > graph) |
bool | IsConstantTensor (const std::string &name) const |
bool | IsDimInputTensor (const std::string &name) const |
bool | IsDynamicTensor (const std::string &name) const |
bool | IsInitializedTensor (const std::string &name) const |
bool | IsReadyInputTensor (const std::string &name) const |
RModel & | operator= (const RModel &other)=delete |
RModel & | operator= (RModel &&other) |
void | OutputGenerated (std::string filename="", bool append=false) |
void | PrintDynamicTensors () |
void | PrintInitializedTensors () |
void | PrintIntermediateTensors () |
void | PrintOutputTensors () |
void | PrintRequiredInputTensors () |
void | ReadInitializedTensorsFromFile (long) |
void | SetFilename (std::string filename) |
void | SetNotWritableInitializedTensor (const std::string &tensor_name) |
void | UpdateInitializedTensor (std::string tensor_name, ETensorType type, std::vector< std::size_t > shape, std::shared_ptr< void > data) |
void | UpdateOutputTensorList (std::vector< std::string > curr_output_tensor, std::vector< std::string > modify_output_tensor) |
bool | UseSession () const |
int | Verbose () const |
long | WriteInitializedTensorsToFile (std::string filename="") |
![]() | |
RModel_Base ()=default | |
Default constructor. | |
RModel_Base (std::string function_name) | |
RModel_Base (std::string name, std::string parsedtime) | |
void | AddBlasRoutines (std::vector< std::string > routines) |
void | AddNeededCustomHeader (std::string filename) |
void | AddNeededStdLib (std::string libname) |
void | GenerateHeaderInfo (std::string &hgname) |
std::string | GetFilename () |
const std::string & | GetName () const |
void | OutputGenerated (std::string filename="", bool append=false) |
void | PrintGenerated () |
std::string | ReturnGenerated () |
void | SetFilename (std::string filename) |
Protected Member Functions | |
void | GenerateDynamicTensorInfo () |
void | GenerateInitializedTensorInfo () |
void | GenerateIntermediateMemoryPool () |
void | GenerateIntermediateTensorInfo () |
void | GenerateOperatorDeclarations () |
void | GenerateOutput () |
void | GenerateSessionCode () |
Private Attributes | |
int | fBatchSize = -1 |
std::unordered_map< std::string, DynamicTensorInfo > | fDynamicTensorInfos |
std::unordered_map< std::string, InitializedTensor > | fInitializedTensors |
std::unordered_map< std::string, InputTensorInfo > | fInputTensorInfos |
std::vector< std::string > | fInputTensorNames |
MemoryPoolInfo | fIntermediateMemoryInfo |
! intermediate memory info (transient) | |
std::unordered_map< std::string_view, size_t > | fIntermediateTensorFrequencyLookup |
! lookup table for intermediate tensor frequency (transient) | |
std::unordered_map< std::string, TensorInfo > | fIntermediateTensorInfos |
bool | fIsInitialized = false |
bool | fIsSubGraph = false |
std::vector< std::unique_ptr< ROperator > > | fOperators |
std::vector< std::string > | fOutputTensorNames |
RModel * | fParentGraph = nullptr |
long | fReadPos = 0 |
std::unordered_map< std::string, TensorInfo > | fReadyInputTensorInfos |
std::unordered_map< std::string, std::string > | fShapeParams |
std::vector< std::shared_ptr< RModel > > | fSubGraphs |
! sub-graph models (transient) | |
int | fVerbose = 0 |
const std::string | SP = " " |
Additional Inherited Members | |
![]() | |
const std::unordered_set< std::string > | fAllowedStdLib = {"vector", "algorithm", "cmath", "memory", "span"} |
std::unordered_set< std::string > | fCustomOpHeaders |
std::string | fFileName |
std::string | fGC |
bool | fIsGNN = false |
bool | fIsGNNComponent = false |
std::string | fName = "UnnamedModel" |
std::unordered_set< std::string > | fNeededBlasRoutines |
std::unordered_set< std::string > | fNeededStdLib = {"vector"} |
std::string | fParseTime |
bool | fUseSession = true |
bool | fUseWeightFile = true |
WeightFileType | fWeightFile = WeightFileType::Text |
#include <TMVA/RModel.hxx>
TMVA::Experimental::SOFIE::RModel::RModel | ( | RModel && | other | ) |
Definition at line 23 of file RModel.cxx.
|
default |
|
default |
Default constructor.
Needed to allow serialization of ROOT objects. See https://root.cern/manual/io_custom_classes/#restrictions-on-types-root-io-can-handle
|
inline |
Definition at line 55 of file RModel.hxx.
|
inline |
Definition at line 58 of file RModel.hxx.
|
inline |
Definition at line 89 of file RModel.hxx.
|
inline |
Definition at line 81 of file RModel.hxx.
void TMVA::Experimental::SOFIE::RModel::AddConstantTensor | ( | std::string | tensor_name, |
ETensorType | type, | ||
std::vector< std::size_t > | shape, | ||
std::shared_ptr< void > | data ) |
Definition at line 192 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::AddDynamicTensor | ( | std::string | tensor_name, |
ETensorType | type, | ||
std::vector< Dim > | shape ) |
Definition at line 244 of file RModel.cxx.
|
inline |
Definition at line 98 of file RModel.hxx.
void TMVA::Experimental::SOFIE::RModel::AddInitializedTensor | ( | std::string | tensor_name, |
ETensorType | type, | ||
std::vector< std::size_t > | shape, | ||
std::shared_ptr< void > | data ) |
Definition at line 182 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::AddInputTensorInfo | ( | std::string | input_name, |
ETensorType | type, | ||
std::vector< Dim > | shape ) |
Definition at line 132 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::AddInputTensorInfo | ( | std::string | input_name, |
ETensorType | type, | ||
std::vector< size_t > | shape ) |
Definition at line 142 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::AddInputTensorName | ( | std::string | name | ) |
Definition at line 151 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::AddIntermediateTensor | ( | std::string | tensor_name, |
ETensorType | type, | ||
std::vector< Dim > | dim_shape ) |
Definition at line 227 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::AddIntermediateTensor | ( | std::string | tensor_name, |
ETensorType | type, | ||
std::vector< std::size_t > | shape ) |
Definition at line 235 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::AddOperator | ( | std::unique_ptr< ROperator > | op, |
int | order_execution = -1 ) |
Definition at line 155 of file RModel.cxx.
|
inline |
Definition at line 70 of file RModel.hxx.
void TMVA::Experimental::SOFIE::RModel::AddOutputTensorNameList | ( | std::vector< std::string > | output_tensor_names | ) |
Definition at line 265 of file RModel.cxx.
std::string TMVA::Experimental::SOFIE::RModel::AllocateIntermediateMemory | ( | std::span< const std::string_view > | op_output_tensors | ) |
Definition at line 305 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::CheckAndFlushIntermediateMemory | ( | std::span< const std::string_view > | op_output_tensors, |
const size_t & | op_idx ) |
Definition at line 360 of file RModel.cxx.
bool TMVA::Experimental::SOFIE::RModel::CheckIfTensorAlreadyExist | ( | std::string | tensor_name | ) |
Definition at line 122 of file RModel.cxx.
TMVA::Experimental::SOFIE::RModel::ClassDefNV | ( | RModel | , |
3 | ) |
|
inline |
Definition at line 141 of file RModel.hxx.
void TMVA::Experimental::SOFIE::RModel::Generate | ( | std::underlying_type_t< Options > | options, |
int | batchSize = -1, | ||
long | pos = 0, | ||
bool | verbose = false ) |
Definition at line 918 of file RModel.cxx.
|
protected |
Definition at line 668 of file RModel.cxx.
Definition at line 681 of file RModel.cxx.
|
protected |
Definition at line 575 of file RModel.cxx.
|
protected |
Definition at line 598 of file RModel.cxx.
|
protected |
Definition at line 607 of file RModel.cxx.
|
protected |
Definition at line 657 of file RModel.cxx.
|
protected |
Definition at line 716 of file RModel.cxx.
|
protected |
Definition at line 809 of file RModel.cxx.
std::vector< Dim > TMVA::Experimental::SOFIE::RModel::GetDynamicTensorShape | ( | std::string | name | ) |
Definition at line 82 of file RModel.cxx.
std::shared_ptr< void > TMVA::Experimental::SOFIE::RModel::GetInitializedTensorData | ( | std::string | tensor_name | ) |
Definition at line 288 of file RModel.cxx.
|
inline |
Definition at line 171 of file RModel.hxx.
|
inline |
Definition at line 180 of file RModel.hxx.
|
inline |
Definition at line 172 of file RModel.hxx.
const std::vector< size_t > & TMVA::Experimental::SOFIE::RModel::GetTensorShape | ( | std::string | name | ) |
Definition at line 56 of file RModel.cxx.
const ETensorType & TMVA::Experimental::SOFIE::RModel::GetTensorType | ( | std::string | name | ) |
Definition at line 94 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::HeadInitializedTensors | ( | std::string | name, |
int | n_print = 50 ) |
Definition at line 1260 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::Initialize | ( | const std::map< std::string, size_t > & | inputParams, |
bool | verbose = false ) |
Definition at line 409 of file RModel.cxx.
Definition at line 399 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::InitializeSubGraph | ( | std::shared_ptr< RModel > | graph | ) |
Definition at line 509 of file RModel.cxx.
Definition at line 206 of file RModel.cxx.
Definition at line 217 of file RModel.cxx.
Definition at line 213 of file RModel.cxx.
Definition at line 202 of file RModel.cxx.
Definition at line 221 of file RModel.cxx.
Definition at line 39 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::OutputGenerated | ( | std::string | filename = "", |
bool | append = false ) |
Definition at line 1296 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::PrintDynamicTensors | ( | ) |
Definition at line 1233 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::PrintInitializedTensors | ( | ) |
Definition at line 1200 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::PrintIntermediateTensors | ( | ) |
Definition at line 1218 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::PrintOutputTensors | ( | ) |
Definition at line 1248 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::PrintRequiredInputTensors | ( | ) |
Definition at line 1170 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::ReadInitializedTensorsFromFile | ( | long | pos | ) |
Definition at line 976 of file RModel.cxx.
|
inline |
Definition at line 181 of file RModel.hxx.
void TMVA::Experimental::SOFIE::RModel::SetNotWritableInitializedTensor | ( | const std::string & | tensor_name | ) |
Definition at line 297 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::UpdateInitializedTensor | ( | std::string | tensor_name, |
ETensorType | type, | ||
std::vector< std::size_t > | shape, | ||
std::shared_ptr< void > | data ) |
Definition at line 279 of file RModel.cxx.
void TMVA::Experimental::SOFIE::RModel::UpdateOutputTensorList | ( | std::vector< std::string > | curr_output_tensor, |
std::vector< std::string > | modify_output_tensor ) |
Definition at line 272 of file RModel.cxx.
|
inline |
Definition at line 201 of file RModel.hxx.
|
inline |
Definition at line 60 of file RModel.hxx.
long TMVA::Experimental::SOFIE::RModel::WriteInitializedTensorsToFile | ( | std::string | filename = "" | ) |
Definition at line 1062 of file RModel.cxx.
|
private |
Definition at line 18 of file RModel.hxx.
|
private |
Definition at line 25 of file RModel.hxx.
|
private |
Definition at line 23 of file RModel.hxx.
|
private |
Definition at line 21 of file RModel.hxx.
|
private |
Definition at line 29 of file RModel.hxx.
|
private |
! intermediate memory info (transient)
Definition at line 39 of file RModel.hxx.
|
private |
! lookup table for intermediate tensor frequency (transient)
Definition at line 40 of file RModel.hxx.
|
private |
Definition at line 24 of file RModel.hxx.
Definition at line 15 of file RModel.hxx.
Definition at line 16 of file RModel.hxx.
|
private |
Definition at line 31 of file RModel.hxx.
|
private |
Definition at line 28 of file RModel.hxx.
|
private |
Definition at line 34 of file RModel.hxx.
|
private |
Definition at line 19 of file RModel.hxx.
|
private |
Definition at line 22 of file RModel.hxx.
|
private |
Definition at line 27 of file RModel.hxx.
|
private |
! sub-graph models (transient)
Definition at line 33 of file RModel.hxx.
|
private |
Definition at line 17 of file RModel.hxx.
|
private |
Definition at line 36 of file RModel.hxx.