Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ParseShape.cxx
Go to the documentation of this file.
3#include "onnx_proto3.pb.h"
4
5namespace TMVA {
6namespace Experimental {
7namespace SOFIE {
8
9ParserFuncSignature ParseShape = [](RModelParser_ONNX &parser, const onnx::NodeProto &nodeproto) {
10 auto input_name = nodeproto.input(0);
12 throw std::runtime_error("TMVA::SOFIE ONNX Parser Shape op has input tensor" + input_name +
13 " but its type is not yet registered");
14 }
15
16 std::unique_ptr<ROperator> op;
17 std::string output_name = nodeproto.output(0);
18 int attr_start = 0;
19 int attr_end = INT_MAX; // cannot use 0 or -1 as default
20
21 for (int_t i = 0; i < nodeproto.attribute_size(); i++) {
22 std::string attribute_name = nodeproto.attribute(i).name();
23 if (attribute_name == "start")
24 attr_start = nodeproto.attribute(i).i();
25 if (attribute_name == "end")
26 attr_end = nodeproto.attribute(i).i();
27 }
28
30
31 // output of Shpe is always an int64 tensor
34 }
35
36 return op;
37};
38
39} // namespace SOFIE
40} // namespace Experimental
41} // 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)
std::function< std::unique_ptr< ROperator >(RModelParser_ONNX &, const onnx::NodeProto &)> ParserFuncSignature
ParserFuncSignature ParseShape
Definition ParseShape.cxx:9
create variable transformations