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);
23 std::runtime_error(
"TMVA::SOFIE ONNX parser Binary op has input tensors of different types");
26 throw std::runtime_error(
"TMVA::SOFIE ONNX Parser Binary op has input tensor " + input_name +
27 " but its type is not yet registered");
31 std::unique_ptr<ROperator> op;
32 std::string output_name = nodeproto.output(0);
39 throw std::runtime_error(
"TMVA::SOFIE - Unsupported - Binary Operator does not yet support input type " +
40 std::to_string(
static_cast<int>(input_type)));
53 return ParseBasicBinary<EBasicBinaryOperator::Add>(parser, nodeproto);
58 return ParseBasicBinary<EBasicBinaryOperator::Sub>(parser, nodeproto);
63 return ParseBasicBinary<EBasicBinaryOperator::Mul>(parser, nodeproto);
68 return ParseBasicBinary<EBasicBinaryOperator::Div>(parser, nodeproto);
73 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
ParserFuncSignature ParseMul
ParserFuncSignature ParsePow
create variable transformations