1#ifndef TMVA_SOFIE_ROPERATOR_IDENTITY
2#define TMVA_SOFIE_ROPERATOR_IDENTITY
11namespace Experimental{
43 if (model.CheckIfTensorAlreadyExist(
fNX) ==
false){
44 throw std::runtime_error(
"TMVA SOFIE Identity Op Input Tensor is not found in model");
47 if (model.IsInitializedTensor(
fNX)) {
50 if (model.IsConstantTensor(
fNX)) {
51 auto inputData =
static_cast<T*
>(model.GetInitializedTensorData(
fNX).get());
61 model.AddInitializedTensor(
fNY, model.GetTensorType(
fNX), model.GetTensorShape(
fNX),
62 model.GetInitializedTensorData(
fNX));
65 model.AddIntermediateTensor(
fNY, model.GetTensorType(
fNX),
fShape);
74 throw std::runtime_error(
"TMVA SOFIE Operator Identity called to Generate without being initialized first");
76 std::stringstream out;
77 out <<
"\n//------ IDENTITY\n";
79 <<
", tensor_" <<
fNY <<
");\n";
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 input
std::vector< ETensorType > TypeInference(std::vector< ETensorType > input) override
bool fIsOutputInitialized
std::vector< std::vector< size_t > > ShapeInference(std::vector< std::vector< size_t > > input) override
void Initialize(RModel &model) override
ROperator_Identity(std::string nameX, std::string nameY)
std::vector< Dim > fShape
std::string Generate(std::string OpName) override
std::vector< std::string_view > fInputTensorNames
bool fIsOutputConstant
flag to identify if operator has a constant output (no need to generate code)
const std::string SP
space used to correctly indent the generated C++ code
std::vector< std::string_view > fOutputTensorNames
std::string ConvertDimShapeToLength(const std::vector< Dim > &shape)
create variable transformations