Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ParseCast.cxx
Go to the documentation of this file.
3#include "onnx_proto3.pb.h"
4
5namespace TMVA {
6namespace Experimental {
7namespace SOFIE {
8
9ParserFuncSignature ParseCast = [](RModelParser_ONNX &parser, const onnx::NodeProto &nodeproto) {
10 auto input_name = nodeproto.input(0);
12 throw std::runtime_error("TMVA::SOFIE ONNX Parser Cast op has input tensor" + input_name +
13 " but its type is not yet registered");
14 }
15
17
18 for (int_t i = 0; i < nodeproto.attribute_size(); i++) {
19 std::string attribute_name = nodeproto.attribute(i).name();
20 if (attribute_name == "to") {
21 output_type = static_cast<ETensorType>(nodeproto.attribute(i).i());
22 }
23 }
25 throw std::runtime_error("TMVA::SOFIE ONNX Parser Cast op has invalid output type");
26
27 std::string output_name = nodeproto.output(0);
28 auto op = std::make_unique<ROperator_Cast>(output_type, nodeproto.input(0), output_name);
29
32 }
33
34 return op;
35};
36
37} // namespace SOFIE
38} // namespace Experimental
39} // 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 ParseCast
Definition ParseCast.cxx:9
create variable transformations