1#ifndef TMVA_SOFIE_ROPERATOR_RNN
2#define TMVA_SOFIE_ROPERATOR_RNN
13namespace Experimental {
75 std::vector<float> activation_beta,
76 std::vector<std::string> activations,
float clip,
77 std::string direction,
size_t hidden_size,
size_t layout,
78 std::string nameX, std::string nameW, std::string nameR,
79 std::string nameB, std::string nameSequence_lens,
80 std::string nameInitial_h, std::string nameY,
86 fNX(UTILITY::Clean_name(nameX)),
fNW(UTILITY::Clean_name(nameW)),
87 fNR(UTILITY::Clean_name(nameR)),
fNB(UTILITY::Clean_name(nameB)),
90 fNY(UTILITY::Clean_name(nameY)),
fNY_h(UTILITY::Clean_name(nameY_h)) {
91 if (std::is_same<T, float>::value) {
94 throw std::runtime_error(
95 "TMVA SOFIE Encountered unsupported type parsing a RNN operator");
103 std::vector<ETensorType>
TypeInference(std::vector<ETensorType> input);
109 std::vector<std::vector<size_t>>
122 std::string
Generate(std::string OpName);
Recurrent Neural Network operator.
std::vector< size_t > fShapeB
Shape of the bias.
std::vector< ETensorType > TypeInference(std::vector< ETensorType > input)
Infers the type of the output tensors.
std::vector< float > fAttrActivationBeta
Scaling values used by some activation functions.
std::vector< std::vector< size_t > > ShapeInference(std::vector< std::vector< size_t > > input)
Infers the shape of the output tensors.
size_t fAttrHiddenSize
Number of the hidden layers.
std::string fNInitial_h
Name of the initial value of the hidden states.
ROperator_RNN(std::vector< float > activation_alpha, std::vector< float > activation_beta, std::vector< std::string > activations, float clip, std::string direction, size_t hidden_size, size_t layout, std::string nameX, std::string nameW, std::string nameR, std::string nameB, std::string nameSequence_lens, std::string nameInitial_h, std::string nameY, std::string nameY_h)
Constructor of ROperator_RNN from the attributes.
std::vector< size_t > fShapeR
Shape of the recurrence.
std::string fNW
Name of the weights.
std::string fNB
Name of the bias.
std::vector< size_t > fShapeY
Shape of the output.
float fAttrClip
Clip threshold.
std::string fType
Type of the tensors.
size_t fAttrLayout
Data layout.
std::string fNY
Name of the output.
std::string fNSequence_lens
Name of the length of the sequences.
std::vector< size_t > fShapeSequence_lens
Shape of the length of the sequences.
std::string Generate(std::string OpName)
Generates the inference code.
std::string fNR
Name of the recurrence.
std::vector< float > fAttrActivationAlpha
Scaling values used by some activation functions.
ROperator_RNN()
Default constructor of ROperator_RNN.
std::vector< size_t > fShapeX
Shape of the input.
std::string fAttrDirection
Direction of processing.
std::string fNX
Name of the input.
void Initialize(RModel &model)
Initialize the model.
std::string GenerateSessionMembersCode(std::string opName)
std::string fNY_h
Name of the last sequence of the output.
std::vector< size_t > fShapeInitial_h
Shape of the initial value of the hidden states.
std::vector< size_t > fShapeW
Shape of the weights.
std::vector< std::string > fAttrActivations
Activation functions.
std::vector< size_t > fShapeY_h
Shape of the last sequence of the output.
create variable transformations