Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
ParseEyeLike.cxx
Go to the documentation of this file.
3#include "onnx_proto3.pb.h"
4
5namespace TMVA {
6namespace Experimental {
7namespace SOFIE {
8
9ParserFuncSignature ParseEyeLike = [](RModelParser_ONNX &parser, const onnx::NodeProto &nodeproto) {
11
12 auto input_name = nodeproto.input(0);
15 } else {
16 throw std::runtime_error("TMVA::SOFIE ONNX Parser Eyelike op has input tensor" + input_name +
17 " but its type is not yet registered");
18 }
19
20 std::unique_ptr<ROperator> op;
21
22 int attr_dtype = -1;
23 int attr_k = 0;
24
25 for (int_t i = 0; i < nodeproto.attribute_size(); i++) {
26 std::string attribute_name = nodeproto.attribute(i).name();
27 if (attribute_name == "dtype")
28 attr_dtype = nodeproto.attribute(i).i();
29 if(attribute_name == "k"){
30 attr_k = nodeproto.attribute(i).i();
31 }
32 }
33 if (attr_dtype < 0)
34 attr_dtype = static_cast<int>(input_type);
35
36 std::string output_name = nodeproto.output(0);
37
39
41
44 }
45
46 return op;
47};
48
49} // namespace SOFIE
50} // namespace Experimental
51} // 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 ParseEyeLike
create variable transformations