Gated Recurrent Unit operator.
Inference code generation for one-layer GRU. Supports forward, reverse and bidirectional GRU. See the ONNX documentation for details about the supported GRU architectures.
Definition at line 24 of file ROperator_GRU.hxx.
Public Member Functions | |
ROperator_GRU () | |
Default constructor of ROperator_GRU. | |
ROperator_GRU (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, size_t linear_before_reset, 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_GRU from the attributes. | |
std::string | Generate (std::string) |
Generate the inference code. | |
std::string | GenerateSessionMembersCode (std::string opName) |
Generate the code for the Session internal data vectors. | |
std::vector< std::string > | GetBlasRoutines () |
Returns the blas routines needed to compile the generated code. | |
void | Initialize (RModel &) |
Initialize the model. | |
std::vector< std::vector< size_t > > | ShapeInference (std::vector< std::vector< size_t > >) |
Infers the shape of the output tensors. | |
std::vector< ETensorType > | TypeInference (std::vector< ETensorType >) |
Infers the type of the output tensors. | |
Public Member Functions inherited from TMVA::Experimental::SOFIE::ROperator | |
virtual | ~ROperator () |
virtual std::string | GenerateInitCode () |
virtual std::vector< std::string > | GetStdLibs () |
virtual std::string | Header () |
Private Attributes | |
std::vector< float > | fAttrActivationAlpha |
Scaling values used by some activation functions. | |
std::vector< float > | fAttrActivationBeta |
Scaling values used by some activation functions. | |
std::vector< std::string > | fAttrActivations |
Activation functions. | |
float | fAttrClip |
Clip threshold. | |
std::string | fAttrDirection |
Direction of processing. | |
size_t | fAttrHiddenSize |
Number of the hidden layers. | |
size_t | fAttrLayout |
Data layout. | |
size_t | fAttrLinearBeforeReset |
Linear layer before the reset gate. | |
std::string | fNB |
Name of the bias. | |
std::string | fNInitial_h |
Name of the initial value of the hidden states. | |
std::string | fNR |
Name of the recurrence. | |
std::string | fNSequence_lens |
Name of the length of the sequences. | |
std::string | fNW |
Name of the weights. | |
std::string | fNX |
Name of the input. | |
std::string | fNY |
Name of the output. | |
std::string | fNY_h |
Name of the last sequence of the output. | |
std::vector< size_t > | fShapeB |
Shape of the bias. | |
std::vector< size_t > | fShapeInitial_h |
Shape of the initial value of hidden states. | |
std::vector< size_t > | fShapeR |
Shape of the recurrence. | |
std::vector< size_t > | fShapeSequence_lens |
Shape of the length of the sequences. | |
std::vector< size_t > | fShapeW |
Shape of the weights. | |
std::vector< size_t > | fShapeX |
Shape of the input. | |
std::vector< size_t > | fShapeY |
Shape of the output. | |
std::vector< size_t > | fShapeY_h |
Shape of the last sequence of the output. | |
std::string | fType |
Type of the tensors. | |
Additional Inherited Members | |
Protected Attributes inherited from TMVA::Experimental::SOFIE::ROperator | |
bool | fUseSession = false |
flag to identify if using the session class | |
const std::string | SP = " " |
space used to correctly indent the generated C++ code | |
#include <TMVA/ROperator_GRU.hxx>
|
inline |
Default constructor of ROperator_GRU.
Definition at line 57 of file ROperator_GRU.hxx.
|
inline |
Constructor of ROperator_GRU from the attributes.
activation_alpha | scaling values used by some activation functions |
activation_beta | scaling values used by some activation functions |
activations | activation functions |
clip | clip threshold |
direction | direction of processing of the sequneces |
hidden_size | number of hidden layers |
layout | data layout |
linear_before_reset | Linear layer before the reset gate |
nameX | name of the input tensor |
nameW | name of the weight tensor |
nameR | name of the recurrence tensor |
nameB | name of the bias tensor |
nameSequence_lens | name of the length of the sequences |
nameInitial_h | name of the initial value of the hidden states |
nameY | name of the output |
nameY_h | name of the last sequence of the output |
Definition at line 78 of file ROperator_GRU.hxx.
|
virtual |
Generate the inference code.
OpName | name of the operator |
Implements TMVA::Experimental::SOFIE::ROperator.
Definition at line 228 of file ROperator_GRU.icc.
|
virtual |
Generate the code for the Session internal data vectors.
opName | name of the operator |
Reimplemented from TMVA::Experimental::SOFIE::ROperator.
Definition at line 183 of file ROperator_GRU.icc.
|
inlinevirtual |
Returns the blas routines needed to compile the generated code.
Reimplemented from TMVA::Experimental::SOFIE::ROperator.
Definition at line 135 of file ROperator_GRU.hxx.
|
virtual |
Initialize the model.
model | Model |
Implements TMVA::Experimental::SOFIE::ROperator.
Definition at line 38 of file ROperator_GRU.icc.
|
virtual |
Infers the shape of the output tensors.
input | shape of the input tensors |
Implements TMVA::Experimental::SOFIE::ROperator.
Definition at line 16 of file ROperator_GRU.icc.
|
virtual |
Infers the type of the output tensors.
input | type of the input tensors |
Implements TMVA::Experimental::SOFIE::ROperator.
Definition at line 9 of file ROperator_GRU.icc.
|
private |
Scaling values used by some activation functions.
Definition at line 26 of file ROperator_GRU.hxx.
|
private |
Scaling values used by some activation functions.
Definition at line 27 of file ROperator_GRU.hxx.
|
private |
Activation functions.
Definition at line 28 of file ROperator_GRU.hxx.
|
private |
Clip threshold.
Definition at line 29 of file ROperator_GRU.hxx.
|
private |
Direction of processing.
Definition at line 30 of file ROperator_GRU.hxx.
|
private |
Number of the hidden layers.
Definition at line 31 of file ROperator_GRU.hxx.
|
private |
Data layout.
Definition at line 32 of file ROperator_GRU.hxx.
|
private |
Linear layer before the reset gate.
Definition at line 33 of file ROperator_GRU.hxx.
|
private |
Name of the bias.
Definition at line 38 of file ROperator_GRU.hxx.
|
private |
Name of the initial value of the hidden states.
Definition at line 40 of file ROperator_GRU.hxx.
|
private |
Name of the recurrence.
Definition at line 37 of file ROperator_GRU.hxx.
|
private |
Name of the length of the sequences.
Definition at line 39 of file ROperator_GRU.hxx.
|
private |
Name of the weights.
Definition at line 36 of file ROperator_GRU.hxx.
|
private |
Name of the input.
Definition at line 35 of file ROperator_GRU.hxx.
|
private |
Name of the output.
Definition at line 41 of file ROperator_GRU.hxx.
|
private |
Name of the last sequence of the output.
Definition at line 42 of file ROperator_GRU.hxx.
|
private |
Shape of the bias.
Definition at line 47 of file ROperator_GRU.hxx.
|
private |
Shape of the initial value of hidden states.
Definition at line 49 of file ROperator_GRU.hxx.
|
private |
Shape of the recurrence.
Definition at line 46 of file ROperator_GRU.hxx.
|
private |
Shape of the length of the sequences.
Definition at line 48 of file ROperator_GRU.hxx.
|
private |
Shape of the weights.
Definition at line 45 of file ROperator_GRU.hxx.
|
private |
Shape of the input.
Definition at line 44 of file ROperator_GRU.hxx.
|
private |
Shape of the output.
Definition at line 50 of file ROperator_GRU.hxx.
|
private |
Shape of the last sequence of the output.
Definition at line 51 of file ROperator_GRU.hxx.
|
private |
Type of the tensors.
Definition at line 53 of file ROperator_GRU.hxx.