3#include "onnx_proto3.pb.h"
6namespace Experimental {
9template <EBasicBinaryOperator Op>
14 for (
int i = 0; i < 2; ++i) {
15 auto input_name = nodeproto.input(i);
22 if (input_type2 != input_type) {
24 std::runtime_error(
"TMVA::SOFIE ONNX parser Binary op has input tensors of different types: " +
30 throw std::runtime_error(
"TMVA::SOFIE ONNX Parser Binary op has input tensor " + input_name +
31 " but its type is not yet registered");
35 std::unique_ptr<ROperator> op;
36 std::string output_name = nodeproto.output(0);
46 throw std::runtime_error(
"TMVA::SOFIE - Unsupported - Binary Operator does not yet support input type " +
47 std::to_string(
static_cast<int>(input_type)));
60 return ParseBasicBinary<EBasicBinaryOperator::Add>(parser, nodeproto);
65 return ParseBasicBinary<EBasicBinaryOperator::Sub>(parser, nodeproto);
70 return ParseBasicBinary<EBasicBinaryOperator::Mul>(parser, nodeproto);
75 return ParseBasicBinary<EBasicBinaryOperator::Div>(parser, nodeproto);
80 return ParseBasicBinary<EBasicBinaryOperator::Pow>(parser, nodeproto);
bool IsRegisteredTensorType(const std::string &)
void RegisterTensorType(const std::string &, ETensorType)
ETensorType GetTensorType(const std::string &name)
ParserFuncSignature ParseDiv
ParserFuncSignature ParseSub
std::unique_ptr< ROperator > ParseBasicBinary(RModelParser_ONNX &parser, const onnx::NodeProto &nodeproto)
ParserFuncSignature ParseAdd
std::function< std::unique_ptr< ROperator >(RModelParser_ONNX &, const onnx::NodeProto &)> ParserFuncSignature
std::string ConvertTypeToString(ETensorType type)
ParserFuncSignature ParseMul
ParserFuncSignature ParsePow
create variable transformations