Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
ParseGather.cxx
Go to the documentation of this file.
3#include "onnx_proto3.pb.h"
4#include <stdexcept>
5
6namespace TMVA {
7namespace Experimental {
8namespace SOFIE {
9
10ParserFuncSignature ParseGather = [](RModelParser_ONNX &parser, const onnx::NodeProto &nodeproto) {
12 auto input_name = nodeproto.input(0);
15 } else {
16 throw std::runtime_error("TMVA::SOFIE ONNX Parser Gather op has input tensor" + input_name +
17 " but its type is not yet registered");
18 }
19
21 auto indices_name = nodeproto.input(1);
22 // indices_type can be an initialized tensor, no need to emit an error if it is not registered
26 throw
27 std::runtime_error("TMVA::SOFIE ONNX Parser Gather op Indices tensor type not supported.");
28 }
29 }
30
31 std::unique_ptr<ROperator> op;
32 std::string output_name = nodeproto.output(0);
33 int64_t attr_axis = 0;
34 if (nodeproto.attribute_size() == 1) {
35 attr_axis = nodeproto.attribute(0).i();
36 }
37
38 switch (input_type) {
41 break;
42 default:
43 throw std::runtime_error("TMVA::SOFIE - Unsupported - Operator Gather does not yet support input type " +
45 }
46
49 }
50
51 return op;
52};
53
54} // namespace SOFIE
55} // namespace Experimental
56} // 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)
ParserFuncSignature ParseGather
std::function< std::unique_ptr< ROperator >(RModelParser_ONNX &, const onnx::NodeProto &)> ParserFuncSignature
std::string ConvertTypeToString(ETensorType type)
create variable transformations