3#include "onnx_proto3.pb.h"
6namespace Experimental {
12 std::string input_name = nodeproto.input(0);
16 throw std::runtime_error(
"TMVA::SOFIE ONNX Parser TopK op has input tensor " + input_name +
17 " but its type is not yet registered");
19 std::string k_name = nodeproto.input(1);
21 throw std::runtime_error(
"TMVA::SOFIE ONNX Parser TopK op has input tensor " + k_name +
22 " but its type is not yet registered");
25 std::unique_ptr<ROperator> op;
27 std::string outputVal_name = nodeproto.output(0);
28 std::string outputInd_name = nodeproto.output(1);
33 for (
int_t i = 0; i < nodeproto.attribute_size(); i++) {
34 std::string attribute_name = nodeproto.attribute(i).name();
35 if (attribute_name ==
"axis")
36 attr_axis = nodeproto.attribute(i).i();
37 if (attribute_name ==
"largest")
38 attr_largest = nodeproto.attribute(i).i();
39 if (attribute_name ==
"sorted")
40 attr_sorted = nodeproto.attribute(i).i();
42 op.reset(
new ROperator_TopK<float>(attr_axis, attr_largest, attr_sorted, k_name, input_name, outputVal_name, outputInd_name));
bool IsRegisteredTensorType(const std::string &)
void RegisterTensorType(const std::string &, ETensorType)
ETensorType GetTensorType(const std::string &name)
ParserFuncSignature ParseTopK
std::function< std::unique_ptr< ROperator >(RModelParser_ONNX &, const onnx::NodeProto &)> ParserFuncSignature
create variable transformations