ROOT
Version v6.34
master
v6.32
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
►
ParseConstant.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
►
ParseIf.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
►
ParseSplit.cxx
►
ParseTanh.cxx
►
ParseTile.cxx
►
ParseTopK.cxx
►
ParseTranspose.cxx
►
RModelParser_ONNX.cxx
►
tmva
►
tmvagui
►
tree
►
tutorials
►
v6-34-00-patches
►
File Members
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
ParseCast.cxx
Go to the documentation of this file.
1
#include "
TMVA/RModelParser_ONNX.hxx
"
2
#include "
TMVA/ROperator_Cast.hxx
"
3
#include "onnx_proto3.pb.h"
4
5
namespace
TMVA
{
6
namespace
Experimental {
7
namespace
SOFIE {
8
9
ParserFuncSignature
ParseCast
= [](
RModelParser_ONNX
&parser,
const
onnx::NodeProto &
nodeproto
) {
10
auto
input_name
=
nodeproto
.input(0);
11
if
(!parser.
IsRegisteredTensorType
(
input_name
)) {
12
throw
std::runtime_error(
"TMVA::SOFIE ONNX Parser Cast op has input tensor"
+
input_name
+
13
" but its type is not yet registered"
);
14
}
15
16
std::unique_ptr<ROperator>
op
;
17
std::string
attr_type
;
18
19
for
(
int_t
i = 0; i <
nodeproto
.attribute_size(); i++) {
20
std::string
attribute_name
=
nodeproto
.attribute(i).name();
21
if
(
attribute_name
==
"to"
)
22
attr_type
=
ConvertTypeToString
(
static_cast<
ETensorType
>
(
nodeproto
.attribute(i).i()));
23
}
24
25
std::string
output_name
=
nodeproto
.output(0);
26
op
.reset(
new
ROperator_Cast
(
attr_type
,
nodeproto
.input(0),
output_name
));
27
28
if
(!parser.
IsRegisteredTensorType
(
output_name
)) {
29
ETensorType
output_type
=
ConvertStringToType
(
attr_type
);
30
parser.
RegisterTensorType
(
output_name
,
output_type
);
31
}
32
33
return
op
;
34
};
35
36
}
// namespace SOFIE
37
}
// namespace Experimental
38
}
// namespace TMVA
RModelParser_ONNX.hxx
ROperator_Cast.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:246
TMVA::Experimental::SOFIE::RModelParser_ONNX::RegisterTensorType
void RegisterTensorType(const std::string &, ETensorType)
Definition
RModelParser_ONNX.cxx:241
TMVA::Experimental::SOFIE::ROperator_Cast
Definition
ROperator_Cast.hxx:16
TMVA::Experimental::SOFIE::ETensorType
ETensorType
Definition
SOFIE_common.hxx:25
TMVA::Experimental::SOFIE::ParserFuncSignature
std::function< std::unique_ptr< ROperator >(RModelParser_ONNX &, const onnx::NodeProto &)> ParserFuncSignature
Definition
RModelParser_ONNX.hxx:22
TMVA::Experimental::SOFIE::int_t
std::int64_t int_t
Definition
SOFIE_common.hxx:30
TMVA::Experimental::SOFIE::ParseCast
ParserFuncSignature ParseCast
Definition
ParseCast.cxx:9
TMVA::Experimental::SOFIE::ConvertTypeToString
std::string ConvertTypeToString(ETensorType type)
Definition
SOFIE_common.cxx:57
TMVA::Experimental::SOFIE::ConvertStringToType
ETensorType ConvertStringToType(std::string type)
Definition
SOFIE_common.cxx:92
TMVA
create variable transformations
Definition
GeneticMinimizer.h:22
tmva
sofie_parsers
src
ParseCast.cxx
ROOT v6-34 - Reference Guide Generated on Sat Apr 12 2025 16:37:40 (GVA Time) using Doxygen 1.10.0