Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
Prototype.cxx
Go to the documentation of this file.
1#include <memory>
2
3#include "TMVA/RModel.hxx"
5
6#include <cctype>
7#include <algorithm>
8
9
10using namespace TMVA::Experimental::SOFIE;
11
12int main(){
13
14
15 RModelParser_ONNX parser;
16 RModel model = parser.Parse("./Linear_64.onnx");
17 RModel model2 = std::move(model);
20 model2.HeadInitializedTensors("18bias");
21 model2.HeadInitializedTensors("0weight");
22
23 std::cout << "===" << std::endl;
24
25 model2.Generate();
26 //model2.PrintGenerated();
27 //model2.Initialize();
29 model2.HeadInitializedTensors("6bias", 100);
30
31
32 std::cout << "===" << std::endl;
33
34
35
36 //model2.PrintGenerated();
37 model2.OutputGenerated();
38 //model2.PrintIntermediateTensors();
39/*
40 std::cout << "===" << std::endl;
41
42 RModel model3;
43 model3.AddInputTensorInfo("1", ETensorType::FLOAT, {1,2,3,4});
44 //auto op = std::make_unique<ROperator_Transpose<float>>({3,2,1,0}, "1", "2");
45 std::unique_ptr<ROperator>op ( new ROperator_Transpose<float>({3,2,1,0}, "1", "2")) ;
46 model3.AddOperator(std::move(op));
47 //op->Initialize(model3);
48 //std::cout << (op->Generate("1"));
49
50 model3.AddInputTensorInfo("3", ETensorType::FLOAT, {2,3});
51 model3.AddInputTensorInfo("4", ETensorType::FLOAT, {3,2});
52 std::unique_ptr<ROperator> op2 (new ROperator_Gemm<float> (1.0, 1.0, 0, 0, "3", "4", "5"));
53 model3.AddOperator(std::move(op2));
54 std::unique_ptr<ROperator> op3 (new ROperator_Relu<float> ("5", "6"));
55 model3.AddOperator(std::move(op3));
56 //op2->Initialize(model3);
57 //std::cout << (op2->Generate("2"));
58
59 model3.Generate();
60 model3.PrintGenerated();
61*/
62}
int main()
Definition Prototype.cxx:12
RModel Parse(std::string filename, bool verbose=false)
void OutputGenerated(std::string filename="", bool append=false)
Definition RModel.cxx:933
void HeadInitializedTensors(std::string name, int n_print=50)
Definition RModel.cxx:897
void Generate(std::underlying_type_t< Options > options, int batchSize=-1, long pos=0)
Definition RModel.cxx:542