Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RModelParser_ONNX.cxx
Go to the documentation of this file.
1#include "Byteswap.h"
3#include "onnx_proto3.pb.h"
4
5#include <stdexcept>
6#include <string>
7#include <memory>
8#include <cassert>
9#include <iostream>
10#include <unordered_map>
11#include <functional>
12#include "TMVA/SOFIE_common.hxx"
13
14namespace TMVA {
15namespace Experimental {
16namespace SOFIE {
17
18// Declaration of operators
19// Unary operators
25// Binary operators
31// Nary operators
36//Comparision Operators
42// Reduce operators
46// Others
76// Decalaration of fused operators
80
81// Definition of RModelParser_ONNX::OperatorsMap
83 // Registered operators
84 std::unordered_map<std::string, ParserFuncSignature> fOperatorsMap;
85};
86
87// Constructor of the parser
88RModelParser_ONNX::RModelParser_ONNX() noexcept : fOperatorsMapImpl(std::make_unique<OperatorsMapImpl>()) {
89 // Register operators
90 // Unary operators
92 RegisterOperator("Reciprocal", ParseReciprocal);
96 // Binary operators
102 // Nary operators
107 //Comparision Operators
108 RegisterOperator("Equal", ParseEq);
110 RegisterOperator("LessOrEqual", ParseLessEq);
111 RegisterOperator("Greater", ParseGreater);
112 RegisterOperator("GreaterOrEqual", ParseGreaterEq);
113 // Reduce operators
114 RegisterOperator("ReduceMean", ParseReduceMean);
115 RegisterOperator("ReduceSumsquare", ParseReduceSumsquare);
116 RegisterOperator("ReduceProd", ParseReduceProd);
117 // Others
118 RegisterOperator("BatchNormalization", ParseBatchNormalization);
120 RegisterOperator("Concat", ParseConcat);
122 RegisterOperator("ConvTranspose", ParseConvTranspose);
125 RegisterOperator("Identity", ParseIdentity);
126 RegisterOperator("LeakyRelu", ParseLeakyRelu);
128 RegisterOperator("AveragePool", ParsePool);
129 RegisterOperator("GlobalAveragePool", ParsePool);
130 RegisterOperator("MaxPool", ParsePool);
132 RegisterOperator("Reshape", ParseReshape);
133 RegisterOperator("Flatten", ParseReshape);
134 RegisterOperator("Squeeze", ParseReshape);
135 RegisterOperator("Unsqueeze", ParseReshape);
139 RegisterOperator("Sigmoid", ParseSigmoid);
141 RegisterOperator("Softmax", ParseSoftmax);
143 RegisterOperator("Softmax", ParseSoftmax);
145 RegisterOperator("Transpose", ParseTranspose);
146 RegisterOperator("MatMul", ParseMatMul);
147 RegisterOperator("LayerNormalization", ParseLayerNormalization);
148 RegisterOperator("Expand", ParseExpand);
149 RegisterOperator("Gather", ParseGather);
152 RegisterOperator("EyeLike", ParseEyeLike);
154}
155
156// Destructor of the parser
158
160{
161 fOperatorsMapImpl->fOperatorsMap[name] = func;
162}
163
165{
166 return fOperatorsMapImpl->fOperatorsMap.find(name) != fOperatorsMapImpl->fOperatorsMap.end();
167}
168
170{
171 std::vector<std::string> ops;
172 ops.reserve(fOperatorsMapImpl->fOperatorsMap.size());
173 for (auto &it : fOperatorsMapImpl->fOperatorsMap) {
174 ops.emplace_back(it.first);
175 }
176 return ops;
177}
178
180{
182}
183
185{
187}
188
190{
192}
193
194// Parse an operator
195std::unique_ptr<ROperator>
196RModelParser_ONNX::ParseOperator(const size_t i, const onnx::GraphProto &graphproto, const std::vector<size_t> &nodes)
197{
198 if (i >= nodes.size())
199 throw std::runtime_error("TMVA::SOFIE - Error in parsing ordered operators " + std::to_string(i) + " is >= " + std::to_string(nodes.size()));
200 int idx = nodes[i];
201 const auto &nodeproto = graphproto.node(idx);
202 const std::string op_type = nodeproto.op_type();
203 if (fVerbose)
204 std::cout << "Parsing an operator " << op_type << std::endl;
205
206 // try to fuse with following operator in case it is not last one
207 if (i < nodes.size() - 1) {
208 int idx2 = nodes[i+1];
209 if (op_type == "MatMul") {
210 // Fuse MatMul and Add
211 if (idx2 < graphproto.node_size() && graphproto.node(idx2).op_type() == "Add") {
212 return ParseFuseMatMulAdd(*this, graphproto.node(idx), graphproto.node(idx2));
213 }
214 else {
215 return ParseMatMul(*this, graphproto.node(idx));
216 }
217 } else if (nodeproto.op_type() == "Conv" || nodeproto.op_type() == "ConvTranspose") {
218 // Fuse Conv or ConvTranspose without bias and Add
219 if (idx2 < graphproto.node_size() && graphproto.node(idx2).op_type() == "Add") {
220 if (nodeproto.op_type() == "Conv") {
221 return ParseFuseConvAdd(*this, graphproto.node(idx), graphproto.node(idx2));
222 } else {
223 return ParseFuseConvTransposeAdd(*this, graphproto.node(idx), graphproto.node(idx2));
224 }
225 }
226 }
227 }
228
229 // skip then the following Add if it was fused before
230 if (idx > 0 && op_type == "Add") {
231 int idx0 = nodes[i - 1];
232 if (graphproto.node(idx0).op_type() == "MatMul")
233 return nullptr;
234 else if (graphproto.node(idx0).op_type() == "ConvTranspose")
235 return nullptr;
236 }
237
238 auto it = fOperatorsMapImpl->fOperatorsMap.find(op_type);
239 if (it == fOperatorsMapImpl->fOperatorsMap.end()) {
240 throw std::runtime_error("TMVA::SOFIE Operator type " + op_type + " is not yet supported");
241 }
242 if (fVerbose) {
243 std::cout << "\tCreating operator " << op_type << std::endl;
244 }
245 return it->second(*this, nodeproto);
246}
247
248// Parse a model
249RModel RModelParser_ONNX::Parse(std::string filename, bool verbose)
250{
251 fVerbose = verbose;
252 char sep = '/';
253#ifdef _WIN32
254 sep = '\\';
255#endif
256 size_t isep = filename.rfind(sep, filename.length());
257 std::string filename_nodir = filename;
258 if (isep != std::string::npos) {
259 filename_nodir = (filename.substr(isep + 1, filename.length() - isep));
260 }
261
262 std::time_t ttime = std::time(0);
263 std::tm *gmt_time = std::gmtime(&ttime);
264 std::string parsetime(std::asctime(gmt_time));
265
266 GOOGLE_PROTOBUF_VERIFY_VERSION;
267 // model I/O
268 onnx::ModelProto model;
269 RModel rmodel(filename_nodir, parsetime);
270
271 fTensorTypeMap.clear();
272
273 std::fstream input(filename, std::ios::in | std::ios::binary);
274 if (!model.ParseFromIstream(&input)) {
275 throw std::runtime_error("TMVA::SOFIE - Failed to parse onnx file " + filename);
276 }
277
278 const onnx::GraphProto &graph = model.graph(); // not a memory leak. model freed automatically at the end.
279 google::protobuf::ShutdownProtobufLibrary();
280
281 // ONNX version is ir_version() - model_version() returns 0
282 if (fVerbose) {
283 std::cout << "ONNX Version " << model.ir_version() << std::endl;
284 }
285
286 std::unordered_set<std::string> initializer_names;
287 for (int i = 0; i < graph.initializer_size(); i++) {
288 initializer_names.insert(graph.initializer(i).name());
289 }
290
291 if (verbose)
292 std::cout << "Parsing model inputs...." << std::endl;
293 /// Loop on model inputs
294 for (int i = 0; i < graph.input_size(); i++) {
295 RegisterTensorType(graph.input(i).name(),
296 static_cast<ETensorType>(graph.input(i).type().tensor_type().elem_type()));
297
298 if (verbose)
299 std::cout << "\tgraph input " << i << " name " << graph.input(i).name() << " type "
300 << graph.input(i).type().tensor_type().elem_type() << std::endl;
301
302 if (initializer_names.find(graph.input(i).name()) != initializer_names.end())
303 continue;
304
305 // input data node is not a weight node (has no initializer)
306 const onnx::ValueInfoProto &valueinfoproto = graph.input(i);
307 std::string input_name = valueinfoproto.name();
308
309 ETensorType type = static_cast<ETensorType>(valueinfoproto.type().tensor_type().elem_type());
311 throw std::runtime_error("TMVA::SOFIE Data type in input tensor " + input_name + " not supported!\n");
312 }
313
314 std::vector<Dim> fShape;
315 bool existParam = false;
316 if (!valueinfoproto.type().tensor_type().has_shape())
317 throw std::runtime_error("TMVA::SOFIE datanode with no shape restrictions is not supported yet");
318 for (int j = 0; j < valueinfoproto.type().tensor_type().shape().dim_size(); j++) {
319 Dim dim;
320 if (valueinfoproto.type().tensor_type().shape().dim(j).value_case() ==
321 onnx::TensorShapeProto_Dimension::ValueCase::kDimValue) {
322 dim.dim = valueinfoproto.type().tensor_type().shape().dim(j).dim_value();
323 } else if (valueinfoproto.type().tensor_type().shape().dim(j).value_case() ==
324 onnx::TensorShapeProto_Dimension::ValueCase::kDimParam) {
325 dim.isParam = true;
326 existParam = true;
327 dim.param = valueinfoproto.type().tensor_type().shape().dim(j).dim_param();
328 } else {
329 throw std::runtime_error("TMVA::SOFIE ONNX file error: Valueinfoproto " + input_name +
330 " has neither dim_value nor dim_param! \n");
331 }
332 fShape.push_back(dim);
333 }
334 if (valueinfoproto.type().tensor_type().shape().dim_size() == 0) {
335 Dim dim;
336 dim.dim = 1;
337 fShape.push_back(dim);
338 } // in case this TensorShapeProto has no dimension message: ONNX IR defines this to be a scalar
339
340 if (!existParam) {
341 std::vector<size_t> fShape_sizet;
342 for (auto &j : fShape) {
343 fShape_sizet.push_back(j.dim);
344 }
345
346 rmodel.AddInputTensorInfo(input_name, type, fShape_sizet);
347 } else {
348 rmodel.AddInputTensorInfo(input_name, type, fShape);
349 }
350 rmodel.AddInputTensorName(input_name); // store also names in given order
351 }
352
353 std::map<std::string, int> allInitializedTensors;
354
355 if (verbose)
356 std::cout << "\nParsing graph initializer list and fill model initialized tensors" << std::endl;
357
358 for (int i = 0; i < graph.initializer_size(); i++) {
359 onnx::TensorProto *tensorproto = const_cast<onnx::TensorProto *>(&graph.initializer(i));
360 std::vector<std::size_t> shape;
361 std::size_t fLength = 1;
362 for (int j = 0; j < tensorproto->dims_size(); j++) {
363 shape.push_back(tensorproto->dims(j));
364 fLength *= tensorproto->dims(j);
365 }
366 // in case of scalars keep an empty shape but with length =1
367
368 std::string input_name = graph.initializer(i).name();
369
370 if (verbose)
371 std::cout << "\t initializer " << i << " name " << input_name << " type " << graph.initializer(i).data_type()
372 << std::endl;
373
374 switch (static_cast<ETensorType>(graph.initializer(i).data_type())) {
375 case ETensorType::FLOAT: {
376 std::shared_ptr<void> data(malloc(fLength * sizeof(float)), free);
377
378 if (!tensorproto->raw_data().empty()) {
379#ifdef R__BYTESWAP
380 std::memcpy(data.get(), tensorproto->raw_data().c_str(), fLength * sizeof(float));
381#else
382 for (std::size_t k = 0; k < fLength; ++k)
383 (reinterpret_cast<uint32_t *>(data.get()))[k] =
384 Rbswap_32((reinterpret_cast<const uint32_t *>(tensorproto->raw_data().c_str()))[k]);
385#endif
386 } else {
387 tensorproto->mutable_float_data()->ExtractSubrange(0, tensorproto->float_data_size(),
388 static_cast<float *>(data.get()));
389 }
390
391 if (verbose) std::cout << "add FLOAT initialized tensor " << input_name << " shape " << ConvertShapeToString(shape) << std::endl;
392 rmodel.AddInitializedTensor(input_name, ETensorType::FLOAT, shape, data);
393 allInitializedTensors[input_name] = i;
394 break;
395 }
396 case ETensorType::INT64: {
397 std::shared_ptr<void> data(malloc(fLength * sizeof(int64_t)), free);
398
399 if (!tensorproto->raw_data().empty()) {
400#ifdef R__BYTESWAP
401 std::memcpy(data.get(), tensorproto->raw_data().c_str(), fLength * sizeof(int64_t));
402#else
403 for (std::size_t k = 0; k < fLength; ++k)
404 (reinterpret_cast<uint64_t *>(data.get()))[k] =
405 Rbswap_64((reinterpret_cast<const uint64_t *>(tensorproto->raw_data().c_str()))[k]);
406#endif
407 } else {
408 tensorproto->mutable_int64_data()->ExtractSubrange(0, tensorproto->int64_data_size(),
409 static_cast<int64_t *>(data.get()));
410 }
411
412 if (verbose) std::cout << "add INT64 initialized tensor " << input_name << " shape " << ConvertShapeToString(shape) << std::endl;
413 rmodel.AddInitializedTensor(input_name, ETensorType::INT64, shape, data);
414 allInitializedTensors[input_name] = i;
415 break;
416 }
417 default:
418 throw std::runtime_error("Data type in weight tensor " + graph.initializer(i).name() + " not supported!\n");
419 }
420 }
421
422 // Initial operator order
423 if (verbose) {
424 std::cout << "\nGraph operator list (ONNX order)\n";
425 for (int i = 0; i < graph.node_size(); i++) {
426 std::cout << "\tOperator " << i << " : " << graph.node(i).op_type() << " , " << graph.node(i).input_size()
427 << " inputs : {";
428 for (int j = 0; j < graph.node(i).input_size(); j++) {
429 std::cout << graph.node(i).input(j);
430 if (j < graph.node(i).input_size() - 1)
431 std::cout << ", ";
432 }
433 std::cout << " }" << std::endl;
434 }
435 }
436
437 // make order of nodes:
438 if (verbose)
439 std::cout << "\nRe-Order graph operator list\n";
440 std::vector<size_t> nodesOrder;
441 nodesOrder.reserve(graph.node_size());
442 std::vector<bool> foundNodes(graph.node_size());
443 // loop at graph inputs
444 std::map<std::string, int> allInputs;
445 for (int i = 0; i < graph.input_size(); i++) {
446 allInputs[graph.input(i).name()] = -1;
447 }
448 do {
449 auto psize = nodesOrder.size();
450 for (int i = 0; i < graph.node_size(); i++) {
451 if (foundNodes[i])
452 continue;
453 // check if all input exists add to list
454 bool existInputs = true;
455 int input_size = graph.node(i).input_size();
456 // special case for Reshape where shape is input and not a weight tensor
457 for (int j = 0; j < input_size; j++) {
458 std::string name = graph.node(i).input(j);
459 // skip empty names
460 if (!name.empty()) {
461 existInputs &= (allInputs.find(name) != allInputs.end() ||
462 allInitializedTensors.find(name) != allInitializedTensors.end());
463 if (fVerbose) {
464 std::cout << graph.node(i).op_type() << " input " << name << " "
465 << bool(allInputs.find(name) != allInputs.end()) << " " <<
466 bool(allInitializedTensors.find(name) != allInitializedTensors.end()) <<
467 existInputs << std::endl;
468 }
469 }
470 }
471 if (!existInputs) {
472 if (fVerbose) {
473 std::cout << "skip op " << graph.node(i).op_type() << " inputs are ";
474 for (int j = 0; j < input_size; j++) {
475 std::cout << graph.node(i).input(j) << " ";
476 }
477 std::cout << std::endl;
478 }
479 continue;
480 }
481 if (verbose)
482 std::cout << "\tadd node " << graph.node(i).op_type() << " order " << i << std::endl;
483
484 nodesOrder.push_back(i);
485 foundNodes[i] = true;
486 // register the outputs
487 for (int j = 0; j < graph.node(i).output_size(); j++) {
488 allInputs[graph.node(i).output(j)] = i;
489 }
490 }
491 // no increment in nodes - something wrong
492 if (nodesOrder.size() == psize) {
493 throw std::runtime_error("TMVA::SOFIE - cannot find a new node ");
494 }
495 } while ((int)nodesOrder.size() < graph.node_size());
496
497 // scan operators for orders
498 if (verbose) {
499 std::cout << "\nGraph operator list (re-ordered)\n";
500 for (int k = 0; k < graph.node_size(); k++) {
501 int i = nodesOrder[k];
502 std::cout << "\tOperator " << i << " : " << graph.node(i).op_type() << " , " << graph.node(i).input_size()
503 << " inputs : {";
504 for (int j = 0; j < graph.node(i).input_size(); j++) {
505 std::cout << graph.node(i).input(j);
506 if (j < graph.node(i).input_size() - 1)
507 std::cout << ", ";
508 }
509 std::cout << " }" << std::endl;
510 }
511 }
512
513 // fill model with operators
514 if (verbose) {
515 std::cout << "Fill RModel with operators...\n";
516 }
517 for (int i = 0; i < graph.node_size(); i++) {
518 std::string op_type = graph.node(nodesOrder[i]).op_type();
519
520 if (verbose) {
521 std::cout << "\t" << i << " " << nodesOrder[i] << " parsing operator " << op_type << std::endl;
522 }
523
524 std::unique_ptr<ROperator> op = ParseOperator(i, graph, nodesOrder);
525 if (!op) {
526 if (verbose) {
527 std::cout << "\t\tskipping operator since it is fused with previous one" << std::endl;
528 }
529 // for skipping the fused nodes like Add after MatMul
530 continue;
531 }
532 rmodel.AddOperator(std::move(op));
533 }
534
535 std::vector<std::string> outputnames;
536 if (verbose)
537 std::cout << "\nParsing Graph output list\n";
538 for (int i = 0; i < graph.output_size(); i++) {
539 if (verbose)
540 std::cout << "\toutput " << i << " name " << graph.output(i).name() << std::endl;
541 outputnames.push_back(graph.output(i).name());
542 }
543 rmodel.AddOutputTensorNameList(outputnames);
544
545 return rmodel;
546}
547
548} // namespace SOFIE
549} // namespace Experimental
550} // namespace TMVA
#define Rbswap_32(x)
Definition Byteswap.h:108
#define Rbswap_64(x)
Definition Byteswap.h:111
dims_t fShape
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 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 data
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
char name[80]
Definition TGX11.cxx:110
#define free
Definition civetweb.c:1539
#define malloc
Definition civetweb.c:1536
void RegisterOperator(const std::string &name, ParserFuncSignature func)
bool IsRegisteredOperator(const std::string &name)
std::unordered_map< std::string, ETensorType > fTensorTypeMap
RModel Parse(std::string filename, bool verbose=false)
std::unique_ptr< ROperator > ParseOperator(const size_t, const onnx::GraphProto &, const std::vector< size_t > &)
void RegisterTensorType(const std::string &, ETensorType)
ETensorType GetTensorType(const std::string &name)
std::vector< std::string > GetRegisteredOperators()
std::unique_ptr< OperatorsMapImpl > fOperatorsMapImpl
void AddInputTensorInfo(std::string input_name, ETensorType type, std::vector< Dim > shape)
Definition RModel.cxx:125
void AddOutputTensorNameList(std::vector< std::string > output_tensor_names)
Definition RModel.cxx:225
void AddInitializedTensor(std::string tensor_name, ETensorType type, std::vector< std::size_t > shape, std::shared_ptr< void > data)
Definition RModel.cxx:161
void AddInputTensorName(std::string name)
Definition RModel.cxx:144
void AddOperator(std::unique_ptr< ROperator > op, int order_execution=-1)
Definition RModel.cxx:148
std::string Clean_name(std::string input_tensor_name)
std::function< std::unique_ptr< ROperator >(RModelParser_ONNX &, const onnx::NodeProto &, const onnx::NodeProto &)> ParserFuseFuncSignature
ParserFuncSignature ParseSqrt
ParserFuncSignature ParseBatchNormalization
ParserFuncSignature ParseGreater
ParserFuncSignature ParseReshape
ParserFuseFuncSignature ParseFuseConvTransposeAdd
ParserFuncSignature ParseReduceMean
ParserFuseFuncSignature ParseFuseMatMulAdd
ParserFuncSignature ParseGather
ParserFuncSignature ParseNeg
ParserFuncSignature ParseLog
ParserFuncSignature ParseLeakyRelu
ParserFuncSignature ParseExp
ParserFuncSignature ParsePool
Definition ParsePool.cxx:9
ParserFuncSignature ParseDiv
ParserFuncSignature ParseLayerNormalization
ParserFuncSignature ParseConcat
ParserFuncSignature ParseMax
ParserFuncSignature ParseEq
ParserFuncSignature ParseIdentity
ParserFuncSignature ParseConvTranspose
ParserFuncSignature ParseReduceProd
ParserFuncSignature ParseSlice
Definition ParseSlice.cxx:9
ParserFuncSignature ParseTranspose
ParserFuncSignature ParseLess
ParserFuncSignature ParseShape
Definition ParseShape.cxx:9
ParserFuncSignature ParseGRU
Definition ParseGRU.cxx:9
ParserFuncSignature ParseMatMul
ParserFuncSignature ParseErf
Definition ParseErf.cxx:9
ParserFuncSignature ParseSub
ParserFuncSignature ParseReduceSumsquare
ParserFuncSignature ParseAdd
ParserFuncSignature ParseRange
Definition ParseRange.cxx:9
ParserFuncSignature ParseExpand
ParserFuncSignature ParseRNN
Definition ParseRNN.cxx:9
std::function< std::unique_ptr< ROperator >(RModelParser_ONNX &, const onnx::NodeProto &)> ParserFuncSignature
ParserFuncSignature ParseLSTM
Definition ParseLSTM.cxx:9
ParserFuncSignature ParseCast
Definition ParseCast.cxx:9
ParserFuncSignature ParseReciprocal
std::string ConvertShapeToString(std::vector< size_t > shape)
ParserFuncSignature ParseSigmoid
ParserFuseFuncSignature ParseFuseConvAdd
ParserFuncSignature ParseSoftmax
ParserFuncSignature ParseGreaterEq
ParserFuncSignature ParseMean
ParserFuncSignature ParseSelu
Definition ParseSelu.cxx:9
ParserFuncSignature ParseLessEq
ParserFuncSignature ParseSum
ParserFuncSignature ParseEyeLike
ParserFuncSignature ParseElu
Definition ParseElu.cxx:9
ParserFuncSignature ParseMin
ParserFuncSignature ParseRelu
Definition ParseRelu.cxx:9
ParserFuncSignature ParseConv
Definition ParseConv.cxx:9
ParserFuncSignature ParseGemm
Definition ParseGemm.cxx:9
ParserFuncSignature ParseMul
ParserFuncSignature ParsePow
ParserFuncSignature ParseTanh
Definition ParseTanh.cxx:9
create variable transformations
Definition graph.py:1
std::unordered_map< std::string, ParserFuncSignature > fOperatorsMap