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