23.05
|
Weights manager interface to handle weights transformations. More...
#include <IWeightsManager.h>
Public Member Functions | |
IWeightsManager () | |
Constructor. More... | |
virtual | ~IWeightsManager ()=default |
Default Destructor. More... | |
IWeightsManager (const IWeightsManager &)=delete | |
Prevent instances of this class to be copy constructed. More... | |
IWeightsManager & | operator= (const IWeightsManager &)=delete |
Prevent instances of this class to be copied. More... | |
IWeightsManager (IWeightsManager &&)=default | |
Allow instances of this class to be move constructed. More... | |
IWeightsManager & | operator= (IWeightsManager &&)=default |
Allow instances of this class to be moved. More... | |
void | manage (const ITensor *weights, ITransformWeights *parent=nullptr) |
Start managing a weights tensor. More... | |
ITensor * | run (const ITensor *weights, ITransformWeights *weights_transform) |
Run the reshape function. More... | |
ITensor * | acquire (const ITensor *weights, ITransformWeights *weights_transform) |
Acquire the requested reshape tensor of the selected weights. More... | |
bool | are_weights_managed (const ITensor *weights) |
Check if the weights are managed. More... | |
void | release (const ITensor *weights) |
Release weights refcount and mark as unused if reaches 0. More... | |
void | pre_mark_as_unused (const ITensor *weights) |
Pre-mark the weights as unused. More... | |
Weights manager interface to handle weights transformations.
Definition at line 36 of file IWeightsManager.h.
IWeightsManager | ( | ) |
Constructor.
Definition at line 28 of file IWeightsManager.cpp.
|
virtualdefault |
Default Destructor.
|
delete |
Prevent instances of this class to be copy constructed.
|
default |
Allow instances of this class to be move constructed.
ITensor * acquire | ( | const ITensor * | weights, |
ITransformWeights * | weights_transform | ||
) |
Acquire the requested reshape tensor of the selected weights.
[in] | weights | Pointer to the weights tensor to be managed |
[in] | weights_transform | Weights transformation object |
Definition at line 122 of file IWeightsManager.cpp.
References IWeightsManager::are_weights_managed(), ARM_COMPUTE_ERROR_ON_MSG, ITransformWeights::get_weights(), ITransformWeights::increase_refcount(), IWeightsManager::manage(), and ITransformWeights::uid().
bool are_weights_managed | ( | const ITensor * | weights | ) |
Check if the weights are managed.
[in] | weights | Pointer to the weights tensor we want to check if managed |
Definition at line 117 of file IWeightsManager.cpp.
Referenced by IWeightsManager::acquire(), IWeightsManager::manage(), IWeightsManager::pre_mark_as_unused(), IWeightsManager::release(), and IWeightsManager::run().
void manage | ( | const ITensor * | weights, |
ITransformWeights * | parent = nullptr |
||
) |
Start managing a weights tensor.
[in] | weights | Pointer to the weights tensor to be managed |
[in] | parent | Parent node in case where the weights are coming from a previous reshape function |
Definition at line 33 of file IWeightsManager.cpp.
References IWeightsManager::are_weights_managed().
Referenced by IWeightsManager::acquire().
|
delete |
Prevent instances of this class to be copied.
|
default |
Allow instances of this class to be moved.
void pre_mark_as_unused | ( | const ITensor * | weights | ) |
Pre-mark the weights as unused.
The weights tensor will get marked as unused only when the counter goes to 0
weights | Weights to mark unused |
Definition at line 169 of file IWeightsManager.cpp.
References IWeightsManager::are_weights_managed().
void release | ( | const ITensor * | weights | ) |
Release weights refcount and mark as unused if reaches 0.
[in] | weights | Weights to release |
Definition at line 155 of file IWeightsManager.cpp.
References IWeightsManager::are_weights_managed(), and ITensor::mark_as_unused().
ITensor * run | ( | const ITensor * | weights, |
ITransformWeights * | weights_transform | ||
) |
Run the reshape function.
[in] | weights | Pointer to the weights tensor we want to reshape |
[in] | weights_transform | Weights transformation object |
Definition at line 56 of file IWeightsManager.cpp.
References IWeightsManager::are_weights_managed(), ARM_COMPUTE_ERROR_ON_MSG, ITransformWeights::get_weights(), ITensor::mark_as_unused(), ITransformWeights::run(), and ITransformWeights::uid().