12 auto input_name = nodeproto.input(0);
16 throw std::runtime_error(
"TMVA::SOFIE ONNX Parser BatchNorm op has input tensor " + input_name +
17 " but its type is not yet registered");
20 std::unique_ptr<ROperator> op;
21 std::string output_name = nodeproto.output(0);
22 float fepsilon = 1
e-05;
23 float fmomentum = 0.9;
24 std::size_t ftraining_mode = 0;
25 for (
int_t i = 0; i < nodeproto.attribute_size(); i++) {
26 const std::string &attribute_name = nodeproto.attribute(i).name();
27 if (attribute_name ==
"epsilon")
28 fepsilon = nodeproto.attribute(i).f();
29 else if (attribute_name ==
"momentum")
30 fmomentum = nodeproto.attribute(i).f();
35 if (nodeproto.input_size() == 5) {
37 nodeproto.input(1), nodeproto.input(2), nodeproto.input(3),
38 nodeproto.input(4), output_name));
40 throw std::runtime_error(
"TMVA::SOFIE ONNX Parser BatchNormalization op requires exactly 5 inputs, got " +
41 std::to_string(nodeproto.input_size()));
45 throw std::runtime_error(
"TMVA::SOFIE - Unsupported - Operator BatchNorm does not yet support input type " +
46 std::to_string(
static_cast<int>(input_type)));