16#include <unordered_map>
21namespace Experimental {
112 throw std::runtime_error(
"TMVA::SOFIE - Failed to read float initialized tensor - actual size is " + std::to_string(tensor->
float_data_size()));
114 std::copy(
src.begin(),
src.end(),
static_cast<float *
>(
data));
121 throw std::runtime_error(
"TMVA::SOFIE - Failed to read double initialized tensor - actual size is " + std::to_string(tensor->
double_data_size()));
123 std::copy(
src.begin(),
src.end(),
static_cast<double *
>(
data));
130 throw std::runtime_error(
"TMVA::SOFIE - Failed to read int32 initialized tensor - actual size is " + std::to_string(tensor->
int32_data_size()));
132 std::copy(
src.begin(),
src.end(),
static_cast<int32_t *
>(
data));
139 throw std::runtime_error(
"TMVA::SOFIE - Failed to read int64 initialized tensor - actual size is " + std::to_string(tensor->
int64_data_size()));
141 std::copy(
src.begin(),
src.end(),
static_cast<int64_t *
>(
data));
151template <std::
size_t N>
152void CopyBswap(
void *
dest,
const void *source, std::size_t nbytes)
155 auto dst =
static_cast<unsigned char *
>(
dest);
156 auto src =
static_cast<const unsigned char *
>(source);
157 for (std::size_t k = 0; k < nbytes; k +=
N) {
159 std::memcpy(&
v,
src + k,
N);
161 std::memcpy(
dst + k, &
v,
N);
166void CopyLEToHost(
void *
dest,
const void *source, std::size_t nbytes, ETensorType tensor_type)
171 std::memcpy(
dest, source, nbytes);
173 case 2: CopyBswap<2>(
dest, source, nbytes);
break;
174 case 4: CopyBswap<4>(
dest, source, nbytes);
break;
175 case 8: CopyBswap<8>(
dest, source, nbytes);
break;
177 throw std::runtime_error(
"Data type " +
ConvertTypeToString(tensor_type) +
" in tensor is not supported!\n");
187 std::shared_ptr<void>
data(malloc(tensor_size), free);
191 if (tensorproto->
raw_data().size() > 0) {
192 if (tensorproto->
raw_data().size() != tensor_size)
193 throw std::runtime_error(
"TMVA::SOFIE - Failed to read raw data of initialized tensor - actual raw size is " +
194 std::to_string(tensorproto->
raw_data().size()));
198 std::memcpy(
data.get(), tensorproto->
raw_data().c_str(), tensor_size);
201 CopyLEToHost(
data.get(), tensorproto->
raw_data().c_str(), tensor_size, tensor_type);
205 switch (tensor_type) {
223 throw std::runtime_error(
"TMVA::SOFIE - ExtractData from TP in BOOL not supported");
227 throw std::runtime_error(
"TMVA::SOFIE - ExtractData from TP in UINT8 not supported");
231 throw std::runtime_error(
"Data type " +
ConvertTypeToString(tensor_type) +
" in weight tensor is not supported!\n");
239 std::string location;
240 size_t offset = 0, buffer_size = 0;
243 if (kv.key() ==
"location") location = kv.value();
244 else if (kv.key() ==
"offset")
offset = std::stoull(kv.value());
245 else if (kv.key() ==
"length") buffer_size = std::stoull(kv.value());
253 if (dataFileName.empty())
255 if (dataFileName.empty())
256 throw std::runtime_error(
"TMVA::SOFIE ONNX : tensor " + tensorproto->
name() +
257 " has external data but no data file location is available");
260 std::cout <<
"Initialized data are stored externally in file " << dataFileName
261 <<
" at location " << location <<
" offset " <<
offset <<
" and with length " << buffer_size << std::endl;
263 if (buffer_size != tensor_size)
264 throw std::runtime_error(
"TMVA::SOFIE ONNX : invalid stored data size vs tensor size");
270 fDataFile.open(dataFileName, std::ios::binary);
272 throw std::runtime_error(
"TMVA::SOFIE ONNX: error reading external weight ONNX data file " + dataFileName);
277 fDataFile.read(
reinterpret_cast<char *
>(
data.get()), buffer_size);
280 CopyLEToHost(
data.get(),
data.get(), buffer_size, tensor_type);
383 std::vector<std::string> ops;
386 ops.emplace_back(it.first);
389 std::sort(ops.begin(), ops.end());
419 const std::string &added = (addnode.
input(0) == convnode.
output(0)) ? addnode.
input(1) : addnode.
input(0);
430std::unique_ptr<ROperator>
433 if (i >= nodes.size())
434 throw std::runtime_error(
"TMVA::SOFIE - Error in parsing ordered operators " + std::to_string(i) +
" is >= " + std::to_string(nodes.size()));
436 const auto &nodeproto = graphproto.
node(idx);
437 const std::string op_type = nodeproto.
op_type();
439 std::cout <<
"Parsing operator " << op_type << std::endl;
445 std::cout <<
"\tFusing operators " << graphproto.
node(idx1).
name()
446 <<
" with " << graphproto.
node(idx1).
name() << std::endl;
462 if (children.size() == 1) {
463 int idx2 = children.front();
464 if (op_type ==
"MatMul") {
470 }
else if (nodeproto.op_type() ==
"Conv" || nodeproto.op_type() ==
"ConvTranspose") {
473 IsConvBiasAdd(graphproto, nodeproto, graphproto.
node(idx2))) {
474 if (nodeproto.op_type() ==
"Conv") {
482 }
else if (nodeproto.op_type() ==
"Gemm") {
488 }
else if (nodeproto.op_type() ==
"BatchNormalization") {
498 std::cout <<
"operator " << op_type <<
" is not supported" << std::endl;
499 throw std::runtime_error(
"TMVA::SOFIE Operator type " + op_type +
" is not yet supported");
502 std::cout <<
"\tCreating operator " << op_type << std::endl;
504 return it->second(*
this, nodeproto);
516 throw std::runtime_error(
"TMVA::SOFIE - Failed to load onnx file " +
filename);
521 std::time_t ttime = std::time(0);
522 std::tm *gmt_time = std::gmtime(&ttime);
523 std::string parsetime(std::asctime(gmt_time));
531 std::string filename_nodir =
filename;
532 if (isep != std::string::npos) {
539 RModel rmodel(filename_nodir, parsetime);
553 throw std::runtime_error(
"TMVA::SOFIE - Failed to parse ONNX model from input stream");
557 std::time_t ttime = std::time(0);
558 std::tm *gmt_time = std::gmtime(&ttime);
559 std::string parsetime(std::asctime(gmt_time));
581 std::fstream
input(
filename, std::ios::in | std::ios::binary);
583 std::cerr <<
"TMVA::SOFIE - Failed to open onnx file " <<
filename << std::endl;
592 auto model = std::make_unique<onnx::ModelProto>();
594 if (!model->ParseFromIstream(&
input)) {
595 std::cerr <<
"TMVA::SOFIE - Failed to parse ONNX model from input stream" << std::endl;
601 std::cout <<
"ONNX Version " << model->ir_version() << std::endl;
608 std::cout <<
"\n" << graph.
name() <<
" Graph operator list\n";
609 for (
int i = 0; i < graph.
node_size(); i++) {
610 const auto & node = graph.
node(i);
611 const std::string opType = node.
op_type();
613 std::cout <<
"\tOperator " << i <<
" : " << opType <<
" (" << node.name() <<
"), " << graph.
node(i).
input_size()
615 for (
int j = 0; j < graph.
node(i).input_size(); j++) {
620 std::cout <<
" }" << std::endl;
624 missingOperators[opType] = level;
626 for (
int j = 0; j < node.attribute_size(); j++) {
627 const auto & attribute = node.attribute(j);
628 if (attribute.has_g()) {
629 const auto & subGraph = attribute.g();
631 CheckGraph(subGraph, level, missingOperators);
641 if (!model)
return false;
646 std::cout <<
"\nModel operator list " << model->producer_name() <<
"\n";
648 std::map<std::string, int> missingOperators;
652 if (!missingOperators.empty()) {
653 std::cout <<
"List of missing operators for model loaded from file " <<
filename << std::endl;
654 for (
auto & op : missingOperators) {
655 std::cout << op.first <<
" " << op.second << std::endl;
659 std::cout <<
"All operators in the loaded model are supported!\n";
667 if (graphName.empty())
668 graphName = graph.
name();
671 std::cout <<
"\nParsing Graph - " << graphName << std::endl;
676 struct FusedOperatorsGuard {
677 std::map<int, std::pair<EFusedOp, int>> &fMap;
678 std::map<int, std::pair<EFusedOp, int>> fSaved;
679 FusedOperatorsGuard(std::map<
int, std::pair<EFusedOp, int>> &map) : fMap(map) { fSaved.swap(fMap); }
680 ~FusedOperatorsGuard() { fMap.swap(fSaved); }
683 std::unordered_set<std::string> initializer_names;
689 std::cout <<
"Parsing model inputs...." << std::endl;
691 for (
int i = 0; i < graph.
input_size(); i++) {
696 std::cout <<
"\tgraph input " << i <<
" name " << graph.
input(i).
name() <<
" type "
699 if (initializer_names.find(graph.
input(i).
name()) != initializer_names.end())
704 std::string input_name = valueinfoproto.
name();
709 bool existParam =
false;
711 throw std::runtime_error(
"TMVA::SOFIE data node with no shape restrictions is not supported yet");
730 throw std::runtime_error(
"TMVA::SOFIE ONNX file error: Valueinfoproto " + input_name +
731 " has neither dim_value nor dim_param! \n");
742 std::vector<size_t> fShape_sizet;
744 fShape_sizet.push_back(j.dim);
754 std::map<std::string, int> allInitializedTensors;
757 std::cout <<
"\nParsing graph initializer list and fill model initialized tensors" << std::endl;
761 std::vector<std::size_t> shape;
762 std::size_t tensor_length = 1;
763 for (
int j = 0; j < tensorproto->
dims_size(); j++) {
764 shape.push_back(tensorproto->
dims(j));
765 tensor_length *= tensorproto->
dims(j);
772 std::cout <<
"\t initializer " << i <<
" name " << tensor_name <<
" type " << graph.
initializer(i).
data_type()
773 <<
" and length " << tensor_length << std::endl;
782 allInitializedTensors[tensor_name] = i;
785 std::cout <<
"add initialized tensor " << tensor_name <<
"with shape " <<
ConvertShapeToString(shape) <<
"and ";
787 std::cout <<
" float data: ";
788 for (
int j = 0; j < std::min(int(tensor_length),3); j++) std::cout << static_cast<float*>(
data.get())[j] <<
" ";
791 std::cout <<
" int64 data: ";
792 for (
int j = 0; j < std::min(int(tensor_length),3); j++) std::cout << static_cast<int64_t*>(
data.get())[j] <<
" ";
795 std::cout <<
" uint8 data: ";
796 for (
int j = 0; j < std::min(int(tensor_length),3); j++) std::cout << static_cast<uint8_t*>(
data.get())[j] <<
" ";
799 std::cout <<
" Boolean data: ";
800 for (
int j = 0; j < std::min(int(tensor_length),3); j++) std::cout << static_cast<bool*>(
data.get())[j] <<
" ";
802 std::cout << std::endl;
808 std::cout <<
"\nGraph operator list (ONNX order)\n";
809 for (
int i = 0; i < graph.
node_size(); i++) {
812 for (
int j = 0; j < graph.
node(i).input_size(); j++) {
817 std::cout <<
" }" << std::endl;
823 std::cout <<
"\n***********************\nRe-Order graph operator list\n*************************\n";
824 std::vector<size_t> nodesOrder;
826 std::vector<bool> foundNodes(graph.
node_size());
829 std::map<std::string, int> allInputs;
830 for (
int i = 0; i < graph.
input_size(); i++) {
834 auto psize = nodesOrder.size();
835 for (
int i = 0; i < graph.
node_size(); i++) {
839 bool existInputs =
true;
843 std::cout <<
"Checking input of Node " << i <<
" : " << graph.
node(i).
name() << std::endl;
844 for (
int j = 0; j < input_size; j++) {
848 existInputs &= (allInputs.find(
name) != allInputs.end() ||
849 allInitializedTensors.find(
name) != allInitializedTensors.end());
851 std::cout <<
"\t\t input " <<
name <<
" "
852 <<
bool(allInputs.find(
name) != allInputs.end()) <<
" " <<
853 bool(allInitializedTensors.find(
name) != allInitializedTensors.end()) <<
" " <<
854 existInputs << std::endl;
860 std::cout <<
"skip node " << graph.
node(i).
op_type() <<
" " << graph.
node(i).
name() <<
" inputs are not existing ";
861 for (
int j = 0; j < input_size; j++) {
862 std::cout << graph.
node(i).
input(j) <<
" ";
864 std::cout << std::endl;
871 std::cout <<
"===> New node " << graph.
node(i).
op_type() <<
" " << graph.
node(i).
name() <<
" order " << i << std::endl;
873 nodesOrder.push_back(i);
874 foundNodes[i] =
true;
876 for (
int j = 0; j < graph.
node(i).output_size(); j++) {
882 if (nodesOrder.size() == psize) {
883 if (!nodesOrder.empty()) {
884 int ilast = nodesOrder.back();
885 std::cout <<
"cannot find a new node after " << graph.
node(ilast).
op_type() <<
" " << graph.
node(ilast).
name() << std::endl;
887 throw std::runtime_error(
"TMVA::SOFIE - cannot find a new node ");
889 }
while ((
int)nodesOrder.size() < graph.
node_size());
893 std::vector<std::vector<int>> nodesChildren(graph.
node_size());
895 for (
int k = 0; k < graph.
node_size(); k++) {
896 int i = nodesOrder[k];
899 for (
const auto& output_name : graph.
node(i).
output()) {
902 int j = nodesOrder[
l];
903 for (
const auto& input_name : graph.
node(j).
input()) {
904 if (input_name == output_name)
905 nodesChildren[i].push_back(j);
913 std::cout <<
"\nGraph operator list (re-ordered)\n";
914 for (
int k = 0; k < graph.
node_size(); k++) {
915 int i = nodesOrder[k];
916 std::cout <<
"\tOperator " << i <<
" : " << graph.
node(i).
op_type() <<
" , " << graph.
node(i).
name() <<
" input tensors : {";
923 std::cout <<
" children : {";
924 for (
const auto & ichild : nodesChildren[i]) {
925 std::cout <<
" [ " << ichild <<
" " << graph.
node(ichild).
op_type() <<
" , " << graph.
node(ichild).
name() <<
"]";
927 std::cout <<
"}" << std::endl;
933 std::cout <<
"Fill RModel with operators...\n";
938 size_t node_order_exec = 0;
939 for (
int i = 0; i < graph.
node_size(); i++) {
940 std::string op_type = graph.
node(nodesOrder[i]).
op_type();
943 std::cout <<
"\t" << i <<
" " << nodesOrder[i] <<
" parsing operator " << op_type << std::endl;
946 std::unique_ptr<ROperator> op =
ParseOperator(i, graph, nodesOrder, nodesChildren[nodesOrder[i]]);
949 std::cout <<
"\t\tskipping operator since it is fused with previous one" << std::endl;
954 rmodel.
AddOperator(std::move(op), node_order_exec++);
957 std::vector<std::string> outputnames;
959 std::cout <<
"\nParsing Graph output list\n";
962 std::cout <<
"\toutput " << i <<
" name " << graph.
output(i).
name() << std::endl;
963 outputnames.push_back(graph.
output(i).
name());
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
std::string fDefaultDataFileName
std::string fOpenedDataFileName
void RegisterOperator(const std::string &name, ParserFuncSignature func)
std::unique_ptr< ROperator > ParseOperator(const size_t, const onnx::GraphProto &, const std::vector< size_t > &, const std::vector< int > &)
std::string fDataFileName
bool IsRegisteredOperator(const std::string &name)
void CheckGraph(const onnx::GraphProto &g, int &level, std::map< std::string, int > &missingOperators)
void ParseONNXGraph(RModel &model, const onnx::GraphProto &g, std::string name="")
RModelParser_ONNX() noexcept
std::unordered_map< std::string, ETensorType > fTensorTypeMap
RModel Parse(std::string const &filename, bool verbose=false)
std::shared_ptr< void > GetInitializedTensorData(onnx::TensorProto *tensorproto, size_t tensor_length, ETensorType type)
std::map< int, std::pair< EFusedOp, int > > fFusedOperators
bool IsRegisteredTensorType(const std::string &)
void RegisterTensorType(const std::string &, ETensorType)
void ResetExternalDataState()
ETensorType GetTensorType(const std::string &name)
std::string fModelDirectory
std::vector< std::string > GetRegisteredOperators()
std::unique_ptr< onnx::ModelProto > LoadModel(const std::string &filename)
std::unique_ptr< OperatorsMapImpl > fOperatorsMapImpl
bool CheckModel(std::string filename, bool verbose=false)
void AddInputTensorInfo(std::string input_name, ETensorType type, std::vector< Dim > shape)
void AddOutputTensorNameList(std::vector< std::string > output_tensor_names)
void AddInitializedTensor(std::string tensor_name, ETensorType type, std::vector< std::size_t > shape, std::shared_ptr< void > data)
void AddInputTensorName(std::string name)
void AddOperator(std::unique_ptr< ROperator > op, int order_execution=-1)
const ValueInfoProto & input(int i) const
const ValueInfoProto & output(int i) const
int initializer_size() const
const std::string & name() const
const NodeProto & node(int i) const
const TensorProto & initializer(int i) const
const std::string & op_type() const
const std::string & input(int i) const
const std::string & output(int i) const
const std::string & name() const
int int32_data_size() const
const std::string & raw_data() const
DataLocation data_location() const
const std::vector< int64_t > & int64_data() const
const std::vector< StringStringEntryProto > & external_data() const
int64_t dims(int i) const
int int64_data_size() const
const std::vector< double > & double_data() const
int float_data_size() const
const std::string & name() const
int double_data_size() const
const std::vector< float > & float_data() const
const std::vector< int32_t > & int32_data() const
const std::string & dim_param() const
ValueCase value_case() const
int64_t dim_value() const
const TensorShapeProto_Dimension & dim(int i) const
const TensorShapeProto & shape() const
const TypeProto_Tensor & tensor_type() const
const TypeProto & type() const
const std::string & name() const
std::string Clean_name(std::string input_tensor_name)
ParserFuncSignature ParseArgMax
ParserFuncSignature ParseBatchNormalization
std::function< std::unique_ptr< ROperator >(RModelParser_ONNX &, const onnx::NodeProto &, const onnx::NodeProto &)> ParserFuseFuncSignature
ParserFuncSignature ParseReshape
ParserFuseFuncSignature ParseFuseConvTransposeAdd
ParserFuseFuncSignature ParseFuseMatMulAdd
ParserFuncSignature ParseGather
ParserFuncSignature ParseWhere
ParserFuncSignature ParseLeakyRelu
std::function< std::unique_ptr< ROperator >(RModelParser_ONNX &, const onnx::NodeProto &)> ParserFuncSignature
ParserFuncSignature ParseEinsum
ParserFuncSignature ParsePool
ParserFuncSignature ParseLayerNormalization
ParserFuncSignature ParseConcat
ParserFuncSignature ParseTopK
void RegisterReduceParsers(RModelParser_ONNX &parser)
ParserFuncSignature ParseIdentity
ParserFuncSignature ParseConvTranspose
ParserFuncSignature ParseNot
ParserFuncSignature ParseSlice
ParserFuncSignature ParseRandom
ParserFuncSignature ParseTranspose
ParserFuncSignature ParseShape
ParserFuncSignature ParseClip
constexpr size_t GetTypeSize(ETensorType type)
ParserFuncSignature ParseScatterND
void RegisterBasicBinaryParsers(RModelParser_ONNX &parser)
ParserFuncSignature ParseGRU
ParserFuncSignature ParseMatMul
ParserFuncSignature ParseErf
ParserFuncSignature ParseNonZero
ParserFuncSignature ParseIf
ParserFuncSignature ParseRange
ParserFuncSignature ParseExpand
ParserFuncSignature ParseRNN
ParserFuncSignature ParseHardSigmoid
ParserFuncSignature ParseLSTM
ParserFuncSignature ParseCast
ParserFuncSignature ParseSwish
ParserFuncSignature ParseSigmoid
ParserFuseFuncSignature ParseFuseConvAdd
ParserFuncSignature ParsePRelu
ParserFuseFuncSignature ParseFuseBatchnormRelu
ParserFuncSignature ParseSoftmax
void RegisterComparisionParsers(RModelParser_ONNX &parser)
std::string ConvertTypeToString(ETensorType type)
ParserFuncSignature ParseGelu
ParserFuncSignature ParseSplit
ParserFuncSignature ParseConstant
ParserFuncSignature ParseSelu
ParserFuncSignature ParseHardSwish
ParserFuncSignature ParseGatherND
ParserFuncSignature ParseEyeLike
ParserFuncSignature ParsePad
ParserFuncSignature ParseElu
void RegisterBasicIsParsers(RModelParser_ONNX &parser)
std::string ConvertShapeToString(const std::vector< size_t > &shape)
ParserFuncSignature ParseRelu
ParserFuncSignature ParseConv
ParserFuncSignature ParseInstanceNormalization
ParserFuncSignature ParseScatterElements
ParserFuncSignature ParseGemm
ParserFuncSignature ParseTile
ParserFuseFuncSignature ParseFuseGemmRelu
void RegisterBasicUnaryParsers(RModelParser_ONNX &parser)
ParserFuncSignature ParseThresholdedRelu
void RegisterBasicNaryParsers(RModelParser_ONNX &parser)
ParserFuncSignature ParseTanh
create variable transformations
Helper templated class for swapping bytes; specializations for N={2,4,8} are provided below.
std::unordered_map< std::string, ParserFuncSignature > fOperatorsMap