Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ParseMatMul.cxx
Go to the documentation of this file.
3#include "onnx_proto3.pb.h"
4
5namespace TMVA {
6namespace Experimental {
7namespace SOFIE {
8
9ParserFuncSignature ParseMatMul = [](RModelParser_ONNX &parser, const onnx::NodeProto &matmulnode) {
11
12 // check input type - only first input from MatMul
13 auto input_name = matmulnode.input(0);
16 } else {
17 throw std::runtime_error("TMVA::SOFIE ONNX Parser MatMul op has input tensor " + input_name +
18 " but its type is not yet registered");
19 }
20
21 std::unique_ptr<ROperator> op;
22
23 // for MatMul there is no alpha and beta : use alpha=1 and beta=0
24 float attr_alpha = 1.0;
25 float attr_beta = 0.0;
28
29 switch (input_type) {
32 matmulnode.input(1), matmulnode.output(0)));
33 break;
34 default:
35 throw std::runtime_error(
36 "TMVA::SOFIE - Unsupported - Operator for fusing MatMul and Add to Gemm does not yet support input type " +
37 std::to_string(static_cast<int>(input_type)));
38 }
39
40 std::string output_name = matmulnode.output(0);
43 }
44
45 return op;
46};
47
48} // namespace SOFIE
49} // namespace Experimental
50} // namespace TMVA
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void RegisterTensorType(const std::string &, ETensorType)
ETensorType GetTensorType(const std::string &name)
std::function< std::unique_ptr< ROperator >(RModelParser_ONNX &, const onnx::NodeProto &)> ParserFuncSignature
ParserFuncSignature ParseMatMul
create variable transformations