Skip to content

Commit

Permalink
ONNX parser ... but corresponding libs conflict with other parsers (?)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfaltermann committed Nov 11, 2023
1 parent 0fdf436 commit a804bb7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/ml.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ namespace sofie {
const std::string &outputname,
const std::string &modelFilePath);

// ROOT::RDF::RNode ONNXEvaluate(ROOT::RDF::RNode df, const std::vector<std::string> &input_vec,
// const std::string &outputname,
// const std::string &modelFilePath);


} // end namespace sofie
Expand Down
24 changes: 24 additions & 0 deletions src/ml.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "TMVA/RModel.hxx"
#include "TMVA/RModelParser_Keras.h"
#include "TMVA/RModelParser_PyTorch.h"
// #include "TMVA/RModelParser_ONNX.hxx"
#include "TMVA/SOFIEHelpers.hxx"
#include "TInterpreter.h"
#include "TSystem.h"
Expand Down Expand Up @@ -229,6 +230,29 @@ ROOT::RDF::RNode PyTorchEvaluate(ROOT::RDF::RNode df,
}


// ROOT::RDF::RNode ONNXEvaluate(ROOT::RDF::RNode df,
// const std::vector<std::string> &input_vec,
// const std::string &outputname,
// const std::string &modelFilePath) {


// bool verboseParser = false;

// Logger::get("ONNXEvaluate")
// ->debug("loading model file {} ...", modelFilePath);
// TMVA::Experimental::SOFIE::RModelParser_ONNX parser;
// TMVA::Experimental::SOFIE::RModel model = parser.Parse(modelFilePath, verboseParser);
// Logger::get("ONNXEvaluate")
// ->debug("finished loading model");

// auto df2 = df.Define(outputname, SOFIEGenerator(input_vec, model, modelFilePath));

// return df2;

// }



} // end namespace sofie
} // end namespace ml
#endif /* GUARD_ML_H */

0 comments on commit a804bb7

Please sign in to comment.