Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ParseBatchNormalization.cxx
Go to the documentation of this file.
3#include "onnx_proto3.pb.h"
4
5namespace TMVA {
6namespace Experimental {
7namespace SOFIE {
8
11
12 auto input_name = nodeproto.input(0);
15 } else {
16 throw std::runtime_error("TMVA::SOFIE ONNX Parser BatchNorm op has input tensor " + input_name +
17 " but its type is not yet registered");
18 }
19
20 std::unique_ptr<ROperator> op;
21 std::string output_name = nodeproto.output(0);
22 float fepsilon = 1e-05;
23 float fmomentum = 0.9;
24 std::size_t ftraining_mode = 0;
25
26 switch (input_type) {
28 if (nodeproto.input_size() == 5) {
29 op.reset(new ROperator_BatchNormalization<float>(fepsilon, fmomentum, ftraining_mode, nodeproto.input(0),
30 nodeproto.input(1), nodeproto.input(2), nodeproto.input(3),
31 nodeproto.input(4), output_name));
32 } else {
33 throw std::runtime_error("TMVA::SOFIE ONNX Parser BatchNormalization op requires exactly 5 inputs, got " +
34 std::to_string(nodeproto.input_size()));
35 }
36 break;
37 default:
38 throw std::runtime_error("TMVA::SOFIE - Unsupported - Operator BatchNorm does not yet support input type " +
39 std::to_string(static_cast<int>(input_type)));
40 }
41
44 }
45
46 return op;
47};
48
49} // namespace SOFIE
50} // namespace Experimental
51} // namespace TMVA
#define e(i)
Definition RSha256.hxx:103
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)
ETensorType GetTensorType(const std::string &name)
ParserFuncSignature ParseBatchNormalization
std::function< std::unique_ptr< ROperator >(RModelParser_ONNX &, const onnx::NodeProto &)> ParserFuncSignature
create variable transformations