Definition at line 12 of file RModel.hxx.
Public Member Functions | |
| RModel ()=default | |
| Default constructor. | |
| RModel (std::string function_name) | |
| RModel (std::string name, std::string parsedtime) | |
| void | AddAliasTensor (const std::string &tensor_name, const std::string &orig_tensor_name) |
| void | AddBlasRoutines (std::vector< std::string > routines) |
| 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) |
| void | AddExtraCodeForDimShapes (const std::string &code) |
| void | AddInitializedTensor (const std::string &tensor_name, ETensorType tensor_type, const std::vector< std::size_t > &shape, void *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 | AddNeededCustomHeader (std::string filename) |
| void | AddNeededStdLib (std::string libname) |
| void | AddOperator (std::unique_ptr< ROperator > op, int order_execution=-1) |
| void | AddOutputTensorNameList (std::vector< std::string > output_tensor_names) |
| void | AddShapeParam (const std::string &name, size_t def_value=0) |
| void | AddShapeTensor (const std::string &name, const std::vector< Dim > &shapeValues, bool scalar=false) |
| 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, 4) | |
| 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) |
| void | GenerateHeaderInfo (std::string &hgname) |
| std::string | GenerateInferSignature (bool isdecl=true) |
| size_t | GetConstantTensorSize () const |
| const std::vector< std::string > & | GetDimShapeNames () const |
| std::vector< Dim > | GetDimTensorShape (const std::string &name) const |
| std::vector< Dim > | GetDynamicTensorShape (const std::string &name) const |
| std::string | GetFilename () |
| std::shared_ptr< void > | GetInitializedTensorData (std::string tensor_name) |
| const std::vector< std::string > & | GetInputTensorNames () const |
| size_t | GetIntermediateTensorSize () const |
| const std::string & | GetName () const |
| size_t | GetOtherTensorSize () const |
| const std::vector< std::string > & | GetOutputTensorNames () const |
| const std::vector< Dim > & | GetShapeTensorValues (const std::string &tensor_name) const |
| template<class T > | |
| std::vector< T > | GetTensorData (const std::string &name) |
| template<> | |
| std::vector< Dim > | GetTensorData (const std::string &name) |
| std::vector< size_t > | GetTensorShape (const std::string &name) const |
| ETensorType | GetTensorType (std::string name) const |
| size_t | GetWeightsTensorSize () const |
| 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 | IsAliasTensor (const std::string &name) const |
| check if a tensor is a alias tensor | |
| 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 |
| bool | IsShapeTensor (const std::string &name) const |
| check if a tensor is a shape tensor | |
| void | OutputGenerated (std::string filename="", bool append=false) |
| void | PrintDynamicTensors () const |
| void | PrintGenerated (std::ostream &os=std::cout) |
| void | PrintInitializedTensors () const |
| void | PrintIntermediateTensors () const |
| void | PrintOutputTensors () const |
| void | PrintRequiredInputTensors () const |
| void | PrintSummary () const |
| void | ReadInitializedTensorsFromFile (long) |
| std::string | ReturnGenerated () |
| void | SetFilename (std::string filename) |
| void | SetNotWritableInitializedTensor (const std::string &tensor_name) |
| void | SetOptimizationLevel (OptimizationLevel optim_level) |
| void | SetUseVDT (bool on) |
| 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 |
| bool | UseVDT () const |
| int | Verbose () const |
| long | WriteInitializedTensorsToFile (std::string filename="") |
Protected Member Functions | |
| std::vector< std::string > | CollectTensorMemberNames (const std::string &input) |
| Collects all identifiers starting with "tensor_" in the input code, provided that the occurrence is not immediately preceded by a character that is valid in a C++ identifier. | |
| void | GenerateDynamicTensorInfo () |
| void | GenerateInitializedTensorInfo () |
| void | GenerateIntermediateMemoryPool () |
| void | GenerateIntermediateTensorInfo () |
| void | GenerateOperatorDeclarations () |
| void | GenerateOutput () |
| void | GenerateRequiredInputTensorInfo () |
| To emit the dimensions of the input tensors as a data member of a session, which is helpful when validating the inference inputs. | |
| void | GenerateSessionCode () |
| bool | IsInputTensorShapeParam (std::string const &name) const |
| Check if a given parameter is used for the shape of an input tensor. | |
Protected Attributes | |
| 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 |
Private Attributes | |
| std::unordered_map< std::string, std::string > | fAliasTensors |
| int | fBatchSize = -1 |
| size_t | fConstantTensorSize = 0 |
| std::vector< std::string > | fDimShapeNames |
| std::unordered_map< std::string, DynamicTensorInfo > | fDynamicTensorInfos |
| std::string | fExtraCodeForDimShapes |
| 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 |
| OptimizationLevel | fOptimizationLevel = OptimizationLevel::kExtended |
| size_t | fOtherTensorSize = 0 |
| 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::unordered_map< std::string, std::pair< std::vector< Dim >, bool > > | fShapeTensors |
| std::vector< std::shared_ptr< RModel > > | fSubGraphs |
| ! sub-graph models (transient) | |
| bool | fUseVDT = false |
| int | fVerbose = 0 |
| size_t | fWeightsTensorSize = 0 |
#include <TMVA/RModel.hxx>
|
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 56 of file RModel.hxx.
|
inline |
Definition at line 59 of file RModel.hxx.
| void TMVA::Experimental::SOFIE::RModel::AddAliasTensor | ( | const std::string & | tensor_name, |
| const std::string & | orig_tensor_name ) |
Definition at line 260 of file RModel.cxx.
|
inlineinherited |
Definition at line 77 of file RModel_Base.hxx.
|
inline |
Definition at line 96 of file RModel.hxx.
|
inline |
Definition at line 88 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 242 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::AddDynamicTensor | ( | std::string | tensor_name, |
| ETensorType | type, | ||
| std::vector< Dim > | shape ) |
Definition at line 328 of file RModel.cxx.
|
inline |
Definition at line 106 of file RModel.hxx.
| void TMVA::Experimental::SOFIE::RModel::AddInitializedTensor | ( | const std::string & | tensor_name, |
| ETensorType | tensor_type, | ||
| const std::vector< std::size_t > & | shape, | ||
| void * | raw_data ) |
Definition at line 232 of file RModel.cxx.
| 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 222 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::AddInputTensorInfo | ( | std::string | input_name, |
| ETensorType | type, | ||
| std::vector< Dim > | shape ) |
Definition at line 168 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::AddInputTensorInfo | ( | std::string | input_name, |
| ETensorType | type, | ||
| std::vector< size_t > | shape ) |
Definition at line 178 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::AddInputTensorName | ( | std::string | name | ) |
Definition at line 187 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::AddIntermediateTensor | ( | std::string | tensor_name, |
| ETensorType | type, | ||
| std::vector< Dim > | dim_shape ) |
Definition at line 311 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 319 of file RModel.cxx.
|
inlineinherited |
Definition at line 88 of file RModel_Base.hxx.
|
inlineinherited |
Definition at line 83 of file RModel_Base.hxx.
| void TMVA::Experimental::SOFIE::RModel::AddOperator | ( | std::unique_ptr< ROperator > | op, |
| int | order_execution = -1 ) |
Definition at line 191 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::AddOutputTensorNameList | ( | std::vector< std::string > | output_tensor_names | ) |
Definition at line 353 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::AddShapeParam | ( | const std::string & | name, |
| size_t | def_value = 0 ) |
Definition at line 345 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::AddShapeTensor | ( | const std::string & | name, |
| const std::vector< Dim > & | shapeValues, | ||
| bool | scalar = false ) |
Definition at line 252 of file RModel.cxx.
| std::string TMVA::Experimental::SOFIE::RModel::AllocateIntermediateMemory | ( | std::span< const std::string_view > | op_output_tensors | ) |
Definition at line 393 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 498 of file RModel.cxx.
| bool TMVA::Experimental::SOFIE::RModel::CheckIfTensorAlreadyExist | ( | std::string | tensor_name | ) |
Definition at line 157 of file RModel.cxx.
| TMVA::Experimental::SOFIE::RModel::ClassDefNV | ( | RModel | , |
| 4 | ) |
|
protected |
Collects all identifiers starting with "tensor_" in the input code, provided that the occurrence is not immediately preceded by a character that is valid in a C++ identifier.
Excludes input and output tensor names. Returns a deduplicated std::vector<std::string>.
Definition at line 1030 of file RModel.cxx.
|
inline |
Definition at line 151 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 1477 of file RModel.cxx.
|
protected |
Definition at line 932 of file RModel.cxx.
|
inherited |
Definition at line 15 of file RModel_Base.cxx.
Definition at line 1088 of file RModel.cxx.
|
protected |
Definition at line 804 of file RModel.cxx.
|
protected |
Definition at line 853 of file RModel.cxx.
|
protected |
Definition at line 864 of file RModel.cxx.
|
protected |
Definition at line 921 of file RModel.cxx.
|
protected |
Definition at line 1143 of file RModel.cxx.
|
protected |
To emit the dimensions of the input tensors as a data member of a session, which is helpful when validating the inference inputs.
Definition at line 1751 of file RModel.cxx.
|
protected |
Definition at line 1259 of file RModel.cxx.
|
inline |
Definition at line 166 of file RModel.hxx.
|
inline |
Definition at line 201 of file RModel.hxx.
| std::vector< Dim > TMVA::Experimental::SOFIE::RModel::GetDimTensorShape | ( | const std::string & | name | ) | const |
Definition at line 100 of file RModel.cxx.
| std::vector< Dim > TMVA::Experimental::SOFIE::RModel::GetDynamicTensorShape | ( | const std::string & | name | ) | const |
Definition at line 111 of file RModel.cxx.
|
inlineinherited |
Definition at line 98 of file RModel_Base.hxx.
| std::shared_ptr< void > TMVA::Experimental::SOFIE::RModel::GetInitializedTensorData | ( | std::string | tensor_name | ) |
Definition at line 376 of file RModel.cxx.
|
inline |
Definition at line 199 of file RModel.hxx.
|
inline |
Definition at line 172 of file RModel.hxx.
|
inlineinherited |
Definition at line 99 of file RModel_Base.hxx.
|
inline |
Definition at line 170 of file RModel.hxx.
|
inline |
Definition at line 200 of file RModel.hxx.
| const std::vector< Dim > & TMVA::Experimental::SOFIE::RModel::GetShapeTensorValues | ( | const std::string & | tensor_name | ) | const |
Definition at line 278 of file RModel.cxx.
|
inline |
Definition at line 245 of file RModel.hxx.
|
inline |
Definition at line 245 of file RModel.hxx.
| std::vector< size_t > TMVA::Experimental::SOFIE::RModel::GetTensorShape | ( | const std::string & | name | ) | const |
Definition at line 64 of file RModel.cxx.
| ETensorType TMVA::Experimental::SOFIE::RModel::GetTensorType | ( | std::string | name | ) | const |
Definition at line 125 of file RModel.cxx.
|
inline |
Definition at line 168 of file RModel.hxx.
| void TMVA::Experimental::SOFIE::RModel::HeadInitializedTensors | ( | std::string | name, |
| int | n_print = 50 ) |
Definition at line 1923 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::Initialize | ( | const std::map< std::string, size_t > & | inputParams, |
| bool | verbose = false ) |
Definition at line 587 of file RModel.cxx.
Definition at line 577 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::InitializeSubGraph | ( | std::shared_ptr< RModel > | graph | ) |
Definition at line 735 of file RModel.cxx.
check if a tensor is a alias tensor
Definition at line 274 of file RModel.cxx.
Definition at line 287 of file RModel.cxx.
Definition at line 301 of file RModel.cxx.
Definition at line 296 of file RModel.cxx.
Definition at line 283 of file RModel.cxx.
|
protected |
Check if a given parameter is used for the shape of an input tensor.
Definition at line 1012 of file RModel.cxx.
Definition at line 305 of file RModel.cxx.
check if a tensor is a shape tensor
Definition at line 270 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::OutputGenerated | ( | std::string | filename = "", |
| bool | append = false ) |
Definition at line 1959 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::PrintDynamicTensors | ( | ) | const |
Definition at line 1894 of file RModel.cxx.
|
inlineinherited |
Definition at line 93 of file RModel_Base.hxx.
| void TMVA::Experimental::SOFIE::RModel::PrintInitializedTensors | ( | ) | const |
Definition at line 1861 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::PrintIntermediateTensors | ( | ) | const |
Definition at line 1879 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::PrintOutputTensors | ( | ) | const |
Definition at line 1909 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::PrintRequiredInputTensors | ( | ) | const |
Definition at line 1831 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::PrintSummary | ( | ) | const |
Definition at line 1734 of file RModel.cxx.
| void TMVA::Experimental::SOFIE::RModel::ReadInitializedTensorsFromFile | ( | long | pos | ) |
Definition at line 1542 of file RModel.cxx.
|
inlineinherited |
Definition at line 95 of file RModel_Base.hxx.
|
inline |
Definition at line 210 of file RModel.hxx.
| void TMVA::Experimental::SOFIE::RModel::SetNotWritableInitializedTensor | ( | const std::string & | tensor_name | ) |
Definition at line 385 of file RModel.cxx.
|
inline |
Definition at line 163 of file RModel.hxx.
|
inline |
Definition at line 232 of file RModel.hxx.
| 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 367 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 360 of file RModel.cxx.
|
inline |
Definition at line 230 of file RModel.hxx.
|
inline |
Definition at line 235 of file RModel.hxx.
|
inline |
Definition at line 61 of file RModel.hxx.
| long TMVA::Experimental::SOFIE::RModel::WriteInitializedTensorsToFile | ( | std::string | filename = "" | ) |
Definition at line 1616 of file RModel.cxx.
|
private |
Definition at line 34 of file RModel.hxx.
|
private |
Definition at line 19 of file RModel.hxx.
|
private |
Definition at line 21 of file RModel.hxx.
|
protectedinherited |
Definition at line 56 of file RModel_Base.hxx.
|
private |
Definition at line 35 of file RModel.hxx.
|
private |
Definition at line 31 of file RModel.hxx.
|
private |
Definition at line 48 of file RModel.hxx.
|
protectedinherited |
Definition at line 48 of file RModel_Base.hxx.
|
protectedinherited |
Definition at line 59 of file RModel_Base.hxx.
|
private |
Definition at line 29 of file RModel.hxx.
|
private |
Definition at line 27 of file RModel.hxx.
|
private |
Definition at line 37 of file RModel.hxx.
|
private |
! intermediate memory info (transient)
Definition at line 45 of file RModel.hxx.
|
private |
! lookup table for intermediate tensor frequency (transient)
Definition at line 46 of file RModel.hxx.
|
private |
Definition at line 30 of file RModel.hxx.
Definition at line 62 of file RModel_Base.hxx.
Definition at line 63 of file RModel_Base.hxx.
Definition at line 15 of file RModel.hxx.
Definition at line 16 of file RModel.hxx.
|
protectedinherited |
Definition at line 58 of file RModel_Base.hxx.
|
protectedinherited |
Definition at line 53 of file RModel_Base.hxx.
|
protectedinherited |
Definition at line 55 of file RModel_Base.hxx.
|
private |
Definition at line 39 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 36 of file RModel.hxx.
|
private |
Definition at line 42 of file RModel.hxx.
|
protectedinherited |
Definition at line 49 of file RModel_Base.hxx.
|
private |
Definition at line 20 of file RModel.hxx.
|
private |
Definition at line 28 of file RModel.hxx.
|
private |
Definition at line 33 of file RModel.hxx.
|
private |
Definition at line 32 of file RModel.hxx.
|
private |
! sub-graph models (transient)
Definition at line 41 of file RModel.hxx.
Definition at line 61 of file RModel_Base.hxx.
Definition at line 17 of file RModel.hxx.
Definition at line 60 of file RModel_Base.hxx.
|
private |
Definition at line 18 of file RModel.hxx.
|
protectedinherited |
Definition at line 51 of file RModel_Base.hxx.
|
private |
Definition at line 22 of file RModel.hxx.