ONE - On-device Neural Engine
|
#include <FunctionSequence.h>
Data Structures | |
struct | DynamicTensorCtx |
Public Member Functions | |
template<typename... Args> | |
FunctionSequence (Args &&...args) | |
virtual | ~FunctionSequence ()=default |
void | run () override |
void | prepare () override |
void | append (std::unique_ptr< IFunction > &&function) |
Appends an IFunction object to the function sequence. | |
void | iterate (const std::function< void(IFunction &)> &fn) |
template<typename T , typename... Args> | |
void | wrap (Args &&...args) |
void | dynamic_tensor_ctx (std::shared_ptr< DynamicTensorCtx > &dynamic_tensor_ctx) |
Prepare to run FunctionSequence which "might" handle dynamic tensor. | |
std::shared_ptr< DynamicTensorCtx > & | dynamic_tensor_ctx () |
void | enableDynamicShapeInferer (bool enable) |
Call this function by passing true if this FunctionSequence handles dynamic tensors and should run DynamicShapeInferer. This function can be called multiple times and if false is passed during multiple calls, DynamicShapeInfere will not be run. | |
void | initRunning () |
Call this function to initialize vars before running. | |
![]() | |
virtual | ~IFunction ()=default |
Protected Attributes | |
std::vector< std::unique_ptr< IFunction > > | _functions |
bool | _enable_dynamic_shape_inferer = false |
std::shared_ptr< DynamicTensorCtx > | _dynamic_tensor_ctx = nullptr |
Definition at line 33 of file FunctionSequence.h.
|
inline |
Definition at line 36 of file FunctionSequence.h.
References _functions.
|
virtualdefault |
void onert::exec::FunctionSequence::append | ( | std::unique_ptr< IFunction > && | function | ) |
Appends an IFunction object to the function sequence.
function | IFunction object to be appended |
Definition at line 68 of file FunctionSequence.cc.
References _functions.
|
inline |
Definition at line 81 of file FunctionSequence.h.
References _dynamic_tensor_ctx.
Referenced by dynamic_tensor_ctx(), and run().
|
inline |
Prepare to run FunctionSequence which "might" handle dynamic tensor.
Definition at line 76 of file FunctionSequence.h.
References _dynamic_tensor_ctx, and dynamic_tensor_ctx().
|
inline |
Call this function by passing true
if this FunctionSequence handles dynamic tensors and should run DynamicShapeInferer. This function can be called multiple times and if false
is passed during multiple calls, DynamicShapeInfere will not be run.
Definition at line 90 of file FunctionSequence.h.
References _enable_dynamic_shape_inferer.
Referenced by run().
|
inline |
Call this function to initialize vars before running.
false
at first run. Once _enable_dynamic_shape_inferer is set to true
it cannot be changed to false
only with calling enableDynamicShapeInferer(). So initializing it to false
is necessary. Definition at line 104 of file FunctionSequence.h.
References _enable_dynamic_shape_inferer.
void onert::exec::FunctionSequence::iterate | ( | const std::function< void(IFunction &)> & | fn | ) |
Definition at line 73 of file FunctionSequence.cc.
References _functions.
|
overridevirtual |
Reimplemented from onert::exec::IFunction.
Definition at line 60 of file FunctionSequence.cc.
References _functions.
|
overridevirtual |
Implements onert::exec::IFunction.
Definition at line 25 of file FunctionSequence.cc.
References _dynamic_tensor_ctx, _enable_dynamic_shape_inferer, _functions, dynamic_tensor_ctx(), and enableDynamicShapeInferer().
Referenced by onert::exec::Job::run().
|
inline |
Definition at line 56 of file FunctionSequence.h.
References _functions.
|
protected |
Definition at line 112 of file FunctionSequence.h.
Referenced by dynamic_tensor_ctx(), dynamic_tensor_ctx(), and run().
|
protected |
Definition at line 110 of file FunctionSequence.h.
Referenced by enableDynamicShapeInferer(), initRunning(), and run().
|
protected |
Definition at line 107 of file FunctionSequence.h.
Referenced by append(), FunctionSequence(), iterate(), prepare(), run(), and wrap().