Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ParseGelu.cxx
Go to the documentation of this file.
3#include "onnx_proto3.pb.h"
4
5namespace TMVA {
6namespace Experimental {
7namespace SOFIE {
8
9ParserFuncSignature ParseGelu = [](RModelParser_ONNX &parser, const onnx::NodeProto &nodeproto) {
11
12 auto input_name = nodeproto.input(0);
15 } else {
16 throw std::runtime_error("TMVA::SOFIE ONNX Parser gelu op has input tensor" + input_name +
17 " but its type is not yet registered");
18 }
19
20 // Read optional 'approximate' attribute (default: "none")
21 std::string approximate = "none";
22 for (int i = 0; i < nodeproto.attribute_size(); i++) {
23 const auto &attr = nodeproto.attribute(i);
24 if (attr.name() == "approximate") {
25 approximate = attr.s();
26 }
27 }
28
29 std::string output_name = nodeproto.output(0);
30
31 auto op = std::make_unique<ROperator_Gelu>(input_name, output_name, approximate);
32
35 }
36
37 return op;
38};
39
40} // namespace SOFIE
41} // namespace Experimental
42} // namespace TMVA
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
void RegisterTensorType(const std::string &, ETensorType)
ETensorType GetTensorType(const std::string &name)
std::function< std::unique_ptr< ROperator >(RModelParser_ONNX &, const onnx::NodeProto &)> ParserFuncSignature
ParserFuncSignature ParseGelu
Definition ParseGelu.cxx:9
create variable transformations