This macro provides a simple example for the parsing of ONNX files into RModel object and further generating the .hxx header files for inference.
inputFile = std::string(
gROOT->GetTutorialsDir()) +
"/tmva/Linear_16.onnx";
std::cout<<"\n\n";
std::cout<<"\n\n";
std::cout<<"Shape of tensor \"16weight\": ";
std::cout<<it<<",";
}
std::cout<<"\n\nData type of tensor \"16weight\": ";
std::cout<<SOFIE::ConvertTypeToString(
tensorType);
std::cout<<"\n\n";
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
RModel Parse(std::string filename, bool verbose=false)
const ETensorType & GetTensorType(std::string name)
void PrintIntermediateTensors()
bool CheckIfTensorAlreadyExist(std::string tensor_name)
void OutputGenerated(std::string filename="", bool append=false)
void PrintInitializedTensors()
const std::vector< size_t > & GetTensorShape(std::string name)
void Generate(std::underlying_type_t< Options > options, int batchSize=-1, long pos=0, bool verbose=false)
void PrintRequiredInputTensors()
- Author
- Sanjiban Sengupta
Definition in file TMVA_SOFIE_ONNX.C.