Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROperator.hxx
Go to the documentation of this file.
1#ifndef TMVA_SOFIE_ROPERATOR
2#define TMVA_SOFIE_ROPERATOR
3
4#include <vector>
5#include <memory>
6
8//#include "RModel.hxx"
9
10
11
12namespace TMVA{
13namespace Experimental{
14namespace SOFIE{
15
16class RModel;
17
19
20
21public:
22 virtual std::vector<std::vector<size_t>> ShapeInference(std::vector<std::vector<size_t>>) = 0;
23 virtual std::vector<ETensorType> TypeInference(std::vector<ETensorType>) = 0;
24 virtual void Initialize(RModel&) = 0;
25 virtual std::string Generate(std::string OpName) = 0; //expect unique opname for each operator within the same RModel
26 // generate initialization code
27 virtual std::string GenerateInitCode() { return "";}
28 // generate session data members specific to operator
29 virtual std::string GenerateSessionMembersCode(std::string /*opName*/) { return ""; }
30 virtual std::string Header() { return "";}
31
32
33 //virtual void Forward_reference() = 0;
34 //irtual void Forward_blas() = 0;
35 virtual ~ROperator(){}
36
37protected:
38
39 const std::string SP = " "; ///< space used to correctly indent the generated C++ code
40 bool fUseSession = false; ///< flag to identify if using the session class
41};
42
43
44
45}//SOFIE
46}//Experimental
47}//TMVA
48
49
50#endif //TMVA_SOFIE_OPERATOR
virtual void Initialize(RModel &)=0
virtual std::string GenerateInitCode()
Definition ROperator.hxx:27
const std::string SP
space used to correctly indent the generated C++ code
Definition ROperator.hxx:39
virtual std::vector< ETensorType > TypeInference(std::vector< ETensorType >)=0
virtual std::string GenerateSessionMembersCode(std::string)
Definition ROperator.hxx:29
virtual std::vector< std::vector< size_t > > ShapeInference(std::vector< std::vector< size_t > >)=0
bool fUseSession
flag to identify if using the session class
Definition ROperator.hxx:40
virtual std::string Generate(std::string OpName)=0
create variable transformations