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