ROOT
Version v6.32
master
v6.34
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
▼
ROOT
ROOT Reference Documentation
Tutorials
►
Functional Parts
►
Namespaces
►
All Classes
▼
Files
▼
File List
►
bindings
►
core
►
documentation
►
geom
►
graf2d
►
graf3d
►
gui
►
hist
►
html
►
io
►
main
►
math
►
montecarlo
►
net
►
proof
►
roofit
►
sql
▼
tmva
doc
►
pymva
►
rmva
►
sofie
▼
sofie_parsers
►
inc
▼
src
►
ParseBasicBinary.cxx
►
ParseBasicNary.cxx
►
ParseBasicUnary.cxx
►
ParseBatchNormalization.cxx
►
ParseCast.cxx
►
ParseComparision.cxx
►
ParseConcat.cxx
►
ParseConv.cxx
►
ParseConvTranspose.cxx
►
ParseElu.cxx
►
ParseErf.cxx
►
ParseExpand.cxx
►
ParseEyeLike.cxx
►
ParseFuseConvAdd.cxx
►
ParseFuseConvTransposeAdd.cxx
►
ParseFuseMatMulAdd.cxx
►
ParseGather.cxx
►
ParseGemm.cxx
►
ParseGRU.cxx
►
ParseIdentity.cxx
►
ParseLayerNormalization.cxx
►
ParseLeakyRelu.cxx
►
ParseLSTM.cxx
►
ParseMatMul.cxx
►
ParsePool.cxx
►
ParseRange.cxx
►
ParseReduce.cxx
►
ParseRelu.cxx
►
ParseReshape.cxx
►
ParseRNN.cxx
►
ParseSelu.cxx
►
ParseShape.cxx
►
ParseSigmoid.cxx
►
ParseSlice.cxx
►
ParseSoftmax.cxx
►
ParseTanh.cxx
►
ParseTranspose.cxx
►
RModelParser_ONNX.cxx
►
tmva
►
tmvagui
►
tree
►
tutorials
►
v6-32-00-patches
►
File Members
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
ParseShape.cxx
Go to the documentation of this file.
1
#include "
TMVA/RModelParser_ONNX.hxx
"
2
#include "
TMVA/ROperator_Shape.hxx
"
3
#include "onnx_proto3.pb.h"
4
5
namespace
TMVA
{
6
namespace
Experimental {
7
namespace
SOFIE {
8
9
ParserFuncSignature
ParseShape
= [](
RModelParser_ONNX
&parser,
const
onnx::NodeProto &
nodeproto
) {
10
ETensorType
input_type
=
ETensorType::UNDEFINED
;
11
auto
input_name
=
nodeproto
.input(0);
12
if
(parser.
IsRegisteredTensorType
(
input_name
)) {
13
input_type
= parser.
GetTensorType
(
input_name
);
14
}
else
{
15
throw
std::runtime_error(
"TMVA::SOFIE ONNX Parser Shape op has input tensor"
+
input_name
+
16
" but its type is not yet registered"
);
17
}
18
19
std::unique_ptr<ROperator>
op
;
20
std::string
output_name
=
nodeproto
.output(0);
21
int
attr_start
= 0;
22
int
attr_end
= -1;
23
24
for
(
int_t
i = 0; i <
nodeproto
.attribute_size(); i++) {
25
std::string
attribute_name
=
nodeproto
.attribute(i).name();
26
if
(
attribute_name
==
"start"
)
27
attr_start
=
nodeproto
.attribute(i).i();
28
if
(
attribute_name
==
"end"
)
29
attr_end
=
nodeproto
.attribute(i).i();
30
}
31
32
op
.reset(
new
ROperator_Shape
(
attr_start
,
attr_end
,
input_name
,
output_name
));
33
34
if
(!parser.
IsRegisteredTensorType
(
output_name
)) {
35
parser.
RegisterTensorType
(
output_name
,
input_type
);
36
}
37
38
return
op
;
39
};
40
41
}
// namespace SOFIE
42
}
// namespace Experimental
43
}
// namespace TMVA
RModelParser_ONNX.hxx
ROperator_Shape.hxx
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TMVA::Experimental::SOFIE::RModelParser_ONNX
Definition
RModelParser_ONNX.hxx:27
TMVA::Experimental::SOFIE::RModelParser_ONNX::IsRegisteredTensorType
bool IsRegisteredTensorType(const std::string &)
Definition
RModelParser_ONNX.cxx:184
TMVA::Experimental::SOFIE::RModelParser_ONNX::RegisterTensorType
void RegisterTensorType(const std::string &, ETensorType)
Definition
RModelParser_ONNX.cxx:179
TMVA::Experimental::SOFIE::RModelParser_ONNX::GetTensorType
ETensorType GetTensorType(const std::string &name)
Definition
RModelParser_ONNX.cxx:189
TMVA::Experimental::SOFIE::ROperator_Shape
Definition
ROperator_Shape.hxx:18
TMVA::Experimental::SOFIE::ETensorType
ETensorType
Definition
SOFIE_common.hxx:25
TMVA::Experimental::SOFIE::ETensorType::UNDEFINED
@ UNDEFINED
TMVA::Experimental::SOFIE::ParserFuncSignature
std::function< std::unique_ptr< ROperator >(RModelParser_ONNX &, const onnx::NodeProto &)> ParserFuncSignature
Definition
RModelParser_ONNX.hxx:22
TMVA::Experimental::SOFIE::ParseShape
ParserFuncSignature ParseShape
Definition
ParseShape.cxx:9
TMVA::Experimental::SOFIE::int_t
std::int64_t int_t
Definition
SOFIE_common.hxx:30
TMVA
create variable transformations
Definition
GeneticMinimizer.h:22
tmva
sofie_parsers
src
ParseShape.cxx
ROOT v6-32 - Reference Guide Generated on Wed Apr 9 2025 05:33:06 (GVA Time) using Doxygen 1.10.0